Ahmed Alaa Eldeen Ahmed Alaa Eldeen - 4 months ago 18
PHP Question

Update Statment

.. i'm trying to do update query in mysql .. how to solve this error

Error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where
membership_num
='1'' at line 1



Query:
Update
MEMBERSHIP
SET
member_id
= 2,
sales_id
=1,
duration
='3 شهور',
start_date
='2016-10-16',
end_date
='2016-10-16',
membership_cost_before
=500,
discount
=0,
member_ship_cost
=500,
membership_type
='Silver',
amout_done
=500,
amount_reminder
= 0,
trainer_id
= where
membership_num
=1

Answer
trainer_id = where membership_num=1

You have to specify what trainer_id is. Right now you just have an = sign with nothing after so that is the syntax error.

Comments