glenelkins Posted March 1, 2006 Share Posted March 1, 2006 i use the following to delete the admin record from a user accounts database:$sql = "DELETE FROM accounts WHERE username=admin";but it brings back this error: Unknown column 'admin' in 'where clause' whats the problem?? Link to comment https://forums.phpfreaks.com/topic/3830-problem-deleteing-record/ Share on other sites More sharing options...
XenoPhage Posted March 1, 2006 Share Posted March 1, 2006 The search term, admin, needs to be in quotes. Link to comment https://forums.phpfreaks.com/topic/3830-problem-deleteing-record/#findComment-13291 Share on other sites More sharing options...
glenelkins Posted March 1, 2006 Author Share Posted March 1, 2006 you mean like$sql = "DELETE FROM accounts WHERE username="admin""; ??? this causes error$sql = "DELETE FROM accounts WHERE username=\"admin\""; ?? causes error$sql = "DELETE FROM accounts WHERE username='admin'"; ?? causes error Link to comment https://forums.phpfreaks.com/topic/3830-problem-deleteing-record/#findComment-13293 Share on other sites More sharing options...
XenoPhage Posted March 1, 2006 Share Posted March 1, 2006 [!--quoteo(post=350624:date=Mar 1 2006, 09:55 AM:name=glenelkins)--][div class=\'quotetop\']QUOTE(glenelkins @ Mar 1 2006, 09:55 AM) [snapback]350624[/snapback][/div][div class=\'quotemain\'][!--quotec--]you mean like$sql = "DELETE FROM accounts WHERE username="admin""; ??? this causes error$sql = "DELETE FROM accounts WHERE username=\"admin\""; ?? causes error$sql = "DELETE FROM accounts WHERE username='admin'"; ?? causes error[/quote]Well, the first one won't work. But the other 2 should. Please post the error you are getting. Link to comment https://forums.phpfreaks.com/topic/3830-problem-deleteing-record/#findComment-13300 Share on other sites More sharing options...
glenelkins Posted March 1, 2006 Author Share Posted March 1, 2006 its ok now thanks. cant remember why i had a problem with it Link to comment https://forums.phpfreaks.com/topic/3830-problem-deleteing-record/#findComment-13312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.