delete query
#1
Hello,

I am trying to delete a row out of my settinggroups table (using PHP), the name is "ST".

Could someone please tell me the code I'd use to do this?

Thankyou in advance.

Edit: Would this maybe work?

$rowDel = "ST";
	$db->delete_query('settinggroups','name='.$rowDel);
Reply
#2
No, it wouldn't work because ST is a string. It should be:
$db->delete_query('settinggroups', "name = 'ST'");
Reply
#3
I guess with variables it is also possible, like:
$rowDel = "ST";
$db->delete_query('settinggroups', "name='".$rowDel."'"); 
//or
$db->delete_query('settinggroups', "name='{$rowDel}'"); 

But if you have only one string, the best way is like Destroy666 said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)