Jump to content

[SOLVED] php/mysql and function not process correctly no errors


acctman

Recommended Posts

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");
}		

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.