Ahmed Alaa Eldeen Ahmed Alaa Eldeen - 4 months ago 16
MySQL Question

Getting Syntax Error for update query in mysql

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.