I'm trying to delete all records of a person in a website that I created through an admin account. The query is as followed:
DELETE FROM users u, user_address ua, pending_order po, product_catalogue pc
WHERE u.user_id = ua.user_id
AND ua.user_id = po.user_id
AND po.user_id = pc.user_id
AND u.user_id = '$user_id'
$user_id
is obtained from an $_POST['user_id']
in a form.
I keep getting this error whenever I run it
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 'u, user_address ua, pending_order po, product_catalogue pc WHERE u.user_id = ua.' at line 1
What's wrong here?