Urgent help needed with advanced query structure!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Urgent help needed with advanced query structure!

Post 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?
samb0057
Forum Commoner
Posts: 27
Joined: Wed Mar 26, 2008 9:51 am

Re: Urgent help needed with advanced query structure!

Post by samb0057 »

You might be able to subsitute `ads`.`id` for the XXXXXX
Post Reply