Connection Coder Connection Coder - 7 months ago 9
PHP Question

DELETE * FROM TABLE WHERE this=that not working

I'm not sure why this query isn't working! This query is to delete the user's account:

$query = mysqli_query($connection, "DELETE * FROM users WHERE cookie='$cookie'");


HOWEVER, when I replace
DELETE
with
SELECT
, it works! Is my
DELETE
syntax wrong?

Answer

You don't need the * when using DELETE. Just do

"DELETE FROM users WHERE cookie='$cookie'"
Comments