RobertSubnet Posted July 22, 2007 Share Posted July 22, 2007 Greetings all. Simple (hopefully) question here. I am trying to write a PHP/MySQL query to delete any users with the first name of margaret. The table name is users The column name is first_name PHP version: 5.2.3 MySQL version: 5.0.37 Connect to the sitename database with the following: $dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); The problem PHP query goes like this: $query1 = "delete from users where first_name = 'margaret'"; I run the query with this: $result = mysqli_query ($dbc, $query1); Unfortunately it doesn't remove the name. In MySQL client the exact same query works perfectly. I have tried putting a space between the single and double quotes at the end, but still no go. Would someone please let me know what I am doing wrong. Thanks! ~Robert Quote Link to comment Share on other sites More sharing options...
Barand Posted July 22, 2007 Share Posted July 22, 2007 Have you checked for any errors? $result = mysqli_query ($dbc, $query1); if (!$result) echo mysqli_error($dbc); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.