error in sql syntax
Posted: Mon Aug 27, 2007 10:35 pm
i used this code:
my purpose is the topic i opened before (selecting from more than 1 table)
it says:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, l.adult adult, l.keywords keywords, l.maxb maxb, a.id id,
where i am wrong?
Code: Select all
$sql="SELECT l.id lid, l.advertiser_id advertiser, l.title title, l.url url, l.displayurl display, l.description desc, l.adult adult, l.keywords keywords, l.maxb maxb, a.id id, a.balance balance FROM listing l ,advertiser a WHERE keywords LIKE '%$keyword%' and balance > 5 and advertiser=lid ORDER BY maxb DESC LIMIT $lim ";
it says:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, l.adult adult, l.keywords keywords, l.maxb maxb, a.id id,
where i am wrong?