daveh33 Posted October 21, 2007 Share Posted October 21, 2007 when I run this code below it doesn't delete the record or display any error message $id = $_GET['id']; include("../dbconnect.php"); mysql_query("DELETE FROM promotions WHERE id='$id'") or die(mysql_error()); Such a simple thing to do but I don't no why it doesn't work ??? Quote Link to comment https://forums.phpfreaks.com/topic/74215-solved-mysql-delete-record/ Share on other sites More sharing options...
pocobueno1388 Posted October 21, 2007 Share Posted October 21, 2007 You $id var is probably null. Do this echo "DELETE FROM promotions WHERE id='$id'"; Post what it gives you. Quote Link to comment https://forums.phpfreaks.com/topic/74215-solved-mysql-delete-record/#findComment-374854 Share on other sites More sharing options...
daveh33 Posted October 21, 2007 Author Share Posted October 21, 2007 Yes you were right it displays: - DELETE FROM promotions WHERE id='' I found the problem - I changed the url and didnt include &id=$id Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/74215-solved-mysql-delete-record/#findComment-374856 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.