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?
You don't need the * when using DELETE
. Just do
"DELETE FROM users WHERE cookie='$cookie'"
When you use SELECT *
, it works because you are selecting all columns from the table. In your case, your query should look like this
DELETE FROM users WHERE cookie='$cookie'
since the columns do not need to be specified here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With