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 ??? 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. 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 Link to comment https://forums.phpfreaks.com/topic/74215-solved-mysql-delete-record/#findComment-374856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.