php/mysql questions can you figure out this error?

I am getting this 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=‘aTTTTT’, email=‘[email protected]’, fi’ at line 1

on this statement:

$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));

I can’t find the error?

Sponsor our Newsletter | Privacy Policy | Terms of Service