Question : How do I specify a table in $query array ?

If I have two tables with the same field name, a key in this case, how do I specify the table name in the query array ?

e.g.
$query = mysql_fetch_array($result);
$authorid       = $query["Pads.AuthorID"];

This doesn't work!

Answer : How do I specify a table in $query array ?

Yes, you can use alias to achieve this,

ref. http://www.w3schools.com/SQL/sql_alias.asp

for example, table1, table 2

select table1.samefield as ts1 , table2.samefield as ts2

then you can select  

$query = mysql_fetch_array($result);
$authorid       = $query["ts1"];
Random Solutions  
 
programming4us programming4us