Page 1 of 1

Urgent help needed with advanced query structure!

Posted: Thu Apr 17, 2008 12:17 pm
by kaisellgren
Hello,

I have this query

Code: Select all

$db -> query('SELECT id,cost,url FROM '.PREFIX."ads WHERE ((SELECT COUNT(user_id) FROM ".PREFIX."member_clicks WHERE ad_id=XXXXXX)<=clicklimit);");
 
The SELECT query selects "id","cost" and "url". Well, that "id" is what I needed to be placed into XXXXXX in the query. How would I achieve this?

Re: Urgent help needed with advanced query structure!

Posted: Fri Apr 18, 2008 11:56 am
by samb0057
You might be able to subsitute `ads`.`id` for the XXXXXX