Simple PHP/mySQL DELETE FROM syntax question


I have tried every variation I can think of on this, and used every example I could find but still can’t get this simple line to work.

Can someone please correct the error in this line.

$query = "DELETE FROM users WHERE username=user_alpha";

Try with ’ ’ around the input value like:

$query = "DELETE FROM users WHERE username='user_alpha'";
$result = mysql_query($query);

That’s also assuming you have an entry in the database that is “user_alpha” as the userName.

That did the trick !

Thanks Yeldarb, once again you have solved my delema. :smiley:

Hehe, anytime :slight_smile:
(last time I don’t think I succeeded hehe ;))