jonnewton Posted February 5, 2008 Share Posted February 5, 2008 I am trying to delete a single record from a mysql db table--here's my code-- $query = "DELETE FROM music_news WHERE email = '[email protected]' LIMIT 1"; mysql_query ($query); When I enter this code in the PHP ADMIN page, it works no problem. But when I use it in a PHP page, it has no effect on the table--the record is not removed. I've tried this every which way without effect. I can retrieve records with the same connection but can't delete. I am wondering if there is some kind of security measure I need to take or something. Any help appreciated! Link to comment https://forums.phpfreaks.com/topic/89573-cant-delete/ Share on other sites More sharing options...
trq Posted February 5, 2008 Share Posted February 5, 2008 Remove the LIMIT clause. Link to comment https://forums.phpfreaks.com/topic/89573-cant-delete/#findComment-458873 Share on other sites More sharing options...
jonnewton Posted February 5, 2008 Author Share Posted February 5, 2008 No difference. I had actually tested that earlier. Entering the same data in the php admin page, with our without limit 1 removes the data, but when sent from the php page no change. Link to comment https://forums.phpfreaks.com/topic/89573-cant-delete/#findComment-458886 Share on other sites More sharing options...
revraz Posted February 5, 2008 Share Posted February 5, 2008 mysql_query ($query) or die (mysql_error()); Link to comment https://forums.phpfreaks.com/topic/89573-cant-delete/#findComment-458889 Share on other sites More sharing options...
jonnewton Posted February 5, 2008 Author Share Posted February 5, 2008 yeah, OK, I did that and got this-- DELETE command denied to user 'music_ramp_l'@'ran.oit.pdx.edu' for table 'music_news' I will call my host, of course, but wondering what does that mean and if I can reset it myself somehow... BTW, thanks to you both for your help so far! Link to comment https://forums.phpfreaks.com/topic/89573-cant-delete/#findComment-458936 Share on other sites More sharing options...
revraz Posted February 5, 2008 Share Posted February 5, 2008 Means whatever id/pw you are using for your connection to the DB doesn't have rights to delete rows. Link to comment https://forums.phpfreaks.com/topic/89573-cant-delete/#findComment-458955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.