I give up! Delete won't work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xterra
Forum Commoner
Posts: 69
Joined: Mon Mar 06, 2006 12:52 pm

I give up! Delete won't work

Post by xterra »

I've tried many variations of this simple syntax:

Code: Select all

$query="DELETE FROM `myTable` WHERE 'ID'='$myId' ";

$result=mysql_query($query);

That should work because all my SELECT statements are just like that except I use the work "Like" just because thats what I saw in tutorials



Code: Select all

$query="SELECT * FROM `myTable` WHERE 'ID' LIKE '$myId' ";

$result=mysql_query($query);
I don't get any errors, just no data is deleted from my database.

Any help is appreciated,
Rob.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

`ID` not 'ID'

` vs '
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Do you have delete permissions?
Post Reply