acctman Posted August 24, 2009 Share Posted August 24, 2009 Can someone assist me with solving my problem as to why the delete_record() function is not processing the queries. no error is being thrown, the unlink.php file has access to the mysql db, the records it's trying to delete is present. include $_SERVER['DOCUMENT_ROOT'] . '/files/unlink.php'; $id = '153062'; delete_record($id); //unlink.php function delete_record($id) { $user = mysql_result(mysql_query("SELECT m_user, m_id FROM rate_members WHERE m_id='" .$id."'"), 0, "m_user"); mysql_query("DELETE FROM ratemy_phpbb3.phpbb_users WHERE username='".$user."'"); $date = mysql_result(mysql_query("SELECT m_date, m_id FROM rate_members WHERE m_id='" .$id."'"), 0, "m_date"); usr_del_dir("/home/ratemy/public_html/rmbimgs/" . date("Y", $date) . "/" . date("m", $date) . "/" . $id . "/"); //remove db entries mysql_query("DELETE FROM rate_blogs WHERE b_user='" .$id."'"); mysql_query("DELETE FROM rate_favourites WHERE f_user='" .$id."'"); mysql_query("DELETE FROM rate_favourites WHERE f_fav='" .$id."'"); mysql_query("DELETE FROM rate_members_ban WHERE b_owner='" .$id."'"); mysql_query("DELETE FROM rate_members_ban WHERE b_banned='" .$id."'"); mysql_query("DELETE FROM rate_messages WHERE msg_sender='" .$id."'"); mysql_query("DELETE FROM rate_messages WHERE msg_recip='" .$id."'"); mysql_query("DELETE FROM rate_mobile_pics WHERE mob_user='" .$id."'"); mysql_query("DELETE FROM rate_phones WHERE ph_user='" .$id."'"); mysql_query("DELETE FROM rate_pictures WHERE i_user='" .$id."'"); mysql_query("DELETE FROM rate_picture_comments WHERE com_for='" .$id."'"); mysql_query("DELETE FROM rate_picture_comments WHERE com_user='" .$id."'"); mysql_query("DELETE FROM rate_private WHERE p_from='" .$id."'"); mysql_query("DELETE FROM rate_private WHERE p_to='" .$id."'"); mysql_query("DELETE FROM rate_profile_views WHERE v_for='" .$id."'"); mysql_query("DELETE FROM rate_ratings WHERE r_for='" .$id."'"); mysql_query("DELETE FROM rate_referrals WHERE ref_by='" .$id."'"); mysql_query("DELETE FROM rate_members_visitors WHERE profile_m_id='" .$id."'"); mysql_query("DELETE FROM rate_members_visitors WHERE visitor_m_id='" .$id."'"); //remove member mysql_query("DELETE FROM rate_members WHERE m_id='" .$id."' . limit 1"); } Quote Link to comment https://forums.phpfreaks.com/topic/171683-solved-phpmysql-and-function-not-process-correctly-no-errors/ Share on other sites More sharing options...
mikesta707 Posted August 24, 2009 Share Posted August 24, 2009 try putting or die(mysql_error()); after all your queries and see what happens Quote Link to comment https://forums.phpfreaks.com/topic/171683-solved-phpmysql-and-function-not-process-correctly-no-errors/#findComment-905311 Share on other sites More sharing options...
acctman Posted August 24, 2009 Author Share Posted August 24, 2009 try putting or die(mysql_error()); after all your queries and see what happens nothing no errors... everything processed fine but no entries were removed. Quote Link to comment https://forums.phpfreaks.com/topic/171683-solved-phpmysql-and-function-not-process-correctly-no-errors/#findComment-905333 Share on other sites More sharing options...
mikesta707 Posted August 24, 2009 Share Posted August 24, 2009 trying printing the id variable to make sure it is populated with data. If the SQL syntax is fine, and everything else is fine this is the only thing I could see being wrong. also I am not sure but are you sure you want to use the $id variable and not the $user variable. just a wild guess on my part Quote Link to comment https://forums.phpfreaks.com/topic/171683-solved-phpmysql-and-function-not-process-correctly-no-errors/#findComment-905339 Share on other sites More sharing options...
acctman Posted August 24, 2009 Author Share Posted August 24, 2009 i found the problem, the limit 1 was cause the script to hault. i removed 'limit 1' and everything works mysql_query("DELETE FROM rate_members WHERE m_id='" .$id."' . limit 1"); Quote Link to comment https://forums.phpfreaks.com/topic/171683-solved-phpmysql-and-function-not-process-correctly-no-errors/#findComment-905372 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.