Jump to content

[SOLVED] double check my queries please...


Recommended Posts

does this look functional, and can i be similfied?

 

function delete_record($id) {
$user = mysql_result(mysql_query("SELECT m_user FROM rate_members WHERE m_id=$id"), 0, "m_user");  
$date = mysql_result(mysql_query("SELECT m_date FROM rate_members WHERE m_id=$id"), 0, "m_date");
usr_del_dir("/home/rimgs/public_html/" . date("Y", $date) . "/" . date("m", $date) . "/" . $id . "/");
//remove db entries
	mysql_query("DELETE FROM chat_plugin_history WHERE from_user=$user");
	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 WHERE m_id=$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_mp3s WHERE mp3_userid=$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_pictures_comments WHERE com_for=$id");
	mysql_query("DELETE FROM rate_pictures_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");
}		

Link to comment
https://forums.phpfreaks.com/topic/146427-solved-double-check-my-queries-please/
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.