View Single Post
  #1 (permalink)  
Old 01-13-09, 05:28 PM
APuppyDog APuppyDog is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
sub query / nested select error in php4

I have a page that works fine in php5 but the same code does not work in php4. Due to the circumstances, i have to make it work in php4 for the time being... can you gurus suggest how I can resolve this to work with php4?

PHP Code:

$sql="select distinct car_auctions.leading_bidder from car_auctions where car_auctions.auction_closed=1 and car_auctions.buyer_fees>0 and car_auctions.buyer_fees_charged_status<>1 and car_auctions.leading_bidder in (SELECT user_master.user_name from user_details,user_master where user_master.user_id=user_details.user_id and user_details.user_status=2)";


$rec=mysql_query($sql);  
$rs=mysql_fetch_array($rec); 
i get the following error
Quote:
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 'SELECT user_master.user_name from user_details,user_master wher
Reply With Quote