vomitbomb Posted May 14, 2008 Share Posted May 14, 2008 For some reason I can print out these values, but I can't delete them, do I have the DELETE syntax wrong or something? I am using basically the same code on another page using SELECT instead of DELETE and that works. $search = $_GET['search']; $searchl = $_GET['searchl']; echo $search; echo $searchl; echo "<h3>Deleting order name: $search $searchl</h3><br>"; //create a query $sql = "DELETE * FROM orders WHERE lname LIKE '$search' AND fname LIKE '$searchl'"; $result = mysql_query($sql, $conn); Link to comment https://forums.phpfreaks.com/topic/105584-solved-why-cant-i-delete-this-database-entry/ Share on other sites More sharing options...
jonsjava Posted May 14, 2008 Share Posted May 14, 2008 change result to this: $result = mysql_query($sql, $conn) or die("Query failed due to: ".mysql_error()); Link to comment https://forums.phpfreaks.com/topic/105584-solved-why-cant-i-delete-this-database-entry/#findComment-540874 Share on other sites More sharing options...
beebum Posted May 14, 2008 Share Posted May 14, 2008 $sql = "DELETE FROM orders WHERE lname LIKE '$search' AND fname LIKE '$searchl'"; You don't specify columns with DELETE. Link to comment https://forums.phpfreaks.com/topic/105584-solved-why-cant-i-delete-this-database-entry/#findComment-540876 Share on other sites More sharing options...
vomitbomb Posted May 14, 2008 Author Share Posted May 14, 2008 thanks! Link to comment https://forums.phpfreaks.com/topic/105584-solved-why-cant-i-delete-this-database-entry/#findComment-540878 Share on other sites More sharing options...
jonsjava Posted May 14, 2008 Share Posted May 14, 2008 Wow. I'm blind. Link to comment https://forums.phpfreaks.com/topic/105584-solved-why-cant-i-delete-this-database-entry/#findComment-540882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.