Jump to content


Photo

problem deleteing record


  • Please log in to reply
4 replies to this topic

#1 glenelkins

glenelkins
  • Members
  • PipPipPip
  • Advanced Member
  • 760 posts
  • LocationBridlington - East Riding of Yorkshire - United Kingdom

Posted 01 March 2006 - 02:44 PM

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??
http://thewebsolutionprovider.com - A Solution For Everything Web!

#2 XenoPhage

XenoPhage
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts

Posted 01 March 2006 - 02:47 PM

The search term, admin, needs to be in quotes.
--
[a href=\"http://blog.godshell.com\" target=\"_blank\"]XenoPhage[/a]
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Something mysterious is formed, born in the silent void. Waiting alone and unmoving, it is at once still and yet in constant motion. It is the source of all programs. I do not know its name, so I will call it the Tao of Programming.[/quote]

#3 glenelkins

glenelkins
  • Members
  • PipPipPip
  • Advanced Member
  • 760 posts
  • LocationBridlington - East Riding of Yorkshire - United Kingdom

Posted 01 March 2006 - 02:55 PM

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



http://thewebsolutionprovider.com - A Solution For Everything Web!

#4 XenoPhage

XenoPhage
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts

Posted 01 March 2006 - 03:23 PM

[!--quoteo(post=350624:date=Mar 1 2006, 09:55 AM:name=glenelkins)--][div class=\'quotetop\']QUOTE(glenelkins @ Mar 1 2006, 09:55 AM) View Post[/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.
--
[a href=\"http://blog.godshell.com\" target=\"_blank\"]XenoPhage[/a]
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Something mysterious is formed, born in the silent void. Waiting alone and unmoving, it is at once still and yet in constant motion. It is the source of all programs. I do not know its name, so I will call it the Tao of Programming.[/quote]

#5 glenelkins

glenelkins
  • Members
  • PipPipPip
  • Advanced Member
  • 760 posts
  • LocationBridlington - East Riding of Yorkshire - United Kingdom

Posted 01 March 2006 - 03:52 PM

its ok now thanks. cant remember why i had a problem with it
http://thewebsolutionprovider.com - A Solution For Everything Web!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users