Jump to content

SQL syntax error


waynew

Recommended Posts

I keep getting

 

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 id FROM jobs WHERE status = 1 AND MONTH(reg_date) = '10'' at line 2

 

$i=0; //reset counter

while($i < sizeof($x_months)){
     
 $profit_result[$i] = mysql_query("SELECT SUM(tender_price) FROM tenders 
                                   WHERE job_id = SELECT id FROM jobs WHERE status = 1 AND MONTH(reg_date) = '$months_timeline[$i]'") or die(mysql_error());
 $i++;
}

 

What's wrong????!

Link to comment
https://forums.phpfreaks.com/topic/114061-sql-syntax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.