Jump to content

error in update statement. can anyone tell me what is wrong?


ellegua220

Recommended Posts

There is an error in this update statement.  Here is the error:

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 'WHERE user.userid = 209 set user.username='ttttt', email='[email protected]', fir' at line 1

here is the code:

$query = sprintf("UPDATE user LEFT JOIN parent_user ON parent_user.userid = user.userid LEFT JOIN parent ON parent.parent_id = parent_user.parent_id WHERE user.userid = $userid set user.username='$username', email='$email', first_name='$first_name', last_name='$last_name', password='$password',phone='$phone', street_address='$street_address', other_address='$other_address', city='$city', state='$state', zipcode='$zipcode', type='$type', school='$school', school_district='$school_district',double_gui='$double_gui',status_id=$status_id,notes='%s',parent.parent_first_name='$parent_first_name',parent.parent_last_name='$parent_last_name' where userid=$userid", mysql_real_escape_string($notes, $mysql_link));

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.