daveoffy Posted December 13, 2008 Share Posted December 13, 2008 I have this $memberid = $_SESSION['SESS_MEMBER_ID']; $friendid = $_GET['FRIEND_ID']; $sql = "DELETE FROM friends WHERE member_id = '$memberid' AND friend_id = '$friendid'"; $result = mysql_query ($sql); if ($result) { Header('Location: friend-remove-success.php'); }else{ echo "Query Failed";} It goes to the header location but it doesn't delete the row where memberid and friend id are the same. Link to comment https://forums.phpfreaks.com/topic/136828-solved-php-remove-rows-from-database/ Share on other sites More sharing options...
revraz Posted December 13, 2008 Share Posted December 13, 2008 Echo $sql and see what the variables contain. Use mysql_error() after your query to see if any errors are reported. Link to comment https://forums.phpfreaks.com/topic/136828-solved-php-remove-rows-from-database/#findComment-714581 Share on other sites More sharing options...
daveoffy Posted December 13, 2008 Author Share Posted December 13, 2008 It says DELETE FROM friends WHERE member_id = '' AND friend_id = '' I guess it can't pull memberid and friendid Link to comment https://forums.phpfreaks.com/topic/136828-solved-php-remove-rows-from-database/#findComment-714590 Share on other sites More sharing options...
daveoffy Posted December 13, 2008 Author Share Posted December 13, 2008 I fixed it. I was my fault. The .htaccess was making it friend_id not FRIEND_ID. Also the session was not working because I did not put session_start() Link to comment https://forums.phpfreaks.com/topic/136828-solved-php-remove-rows-from-database/#findComment-714597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.