selecting from more than 1 table
Posted: Mon Aug 27, 2007 7:57 am
Hi
I need to use info from 2 tables. i use this code:
then i need to use mysql_fech_array you know.
$row2=mysql_fetch_array($result2)
then how should i specify array elements?
we used $listing=$row2['id']; what now? when i use $listing=$row2['l.id']; it seems not working
I need to use info from 2 tables. i use this code:
Code: Select all
$sql2="SELECT l.id , l.advertiser_id , l.title , l.url , l.displayurl , l.description , l.adult , l.keywords , l.maxb , a.id , a.balance FROM listing l ,advertiser a WHERE keywords LIKE '%$keyword%' and a.balance>5 and l.advertiser_id=a.id ORDER BY maxb DESC LIMIT $lim ";$row2=mysql_fetch_array($result2)
then how should i specify array elements?
we used $listing=$row2['id']; what now? when i use $listing=$row2['l.id']; it seems not working