Jump to content

MySQL query question


RobertSubnet

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.