I have two tables, classified and fordon.
classified table:
classified_id (PK)
etc...
fordon table:
id (PK)
classified_id (FK)
I try to use this code:
SELECT * FROM classified, fordon WHERE classified.ad_id IN ('$solr_id_arr_imploded') AND classified.classified_id=fordon.classified_id
BTW, the array is a set of ad_id:s returned from solr, never mind that, that is not the problem here...
Then I use mysql_fetch_array in a while-loop to display all the results:
while($row = mysql_fetch_array($qry_result)){
but when I try to echo something which is inside the table fordon, then the index can't be found error appears. But whatever is inside the table classified works to echo!
Any ideas?
Thanks
UPDATE
while($row = mysql_fetch_array($qry_result)){
echo $row['type']; // This doesn't work, because the 'type' column is inside the 'fordon' table
echo $row['headline']; // This does work because it's inside 'classified' table.