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 Link to comment https://forums.phpfreaks.com/topic/61270-mysql-query-question/ 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); Link to comment https://forums.phpfreaks.com/topic/61270-mysql-query-question/#findComment-305012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.