Jump to content

Duplicate Entries


mcmuney

Recommended Posts

I'm using the code below to delete a line and after delete, it's running the //insert coin system function. The problem is that after it deletes the record, the coin system function is being duplicated (being written twice), any reason why it's doing that? It's should only write once:

[code]
<?

$id=$_GET['id'];

$sci_id=$_GET['sci_id'];



if($id!=="" && $sci_id!="")

{

$del_msg="delete from sc_postcomment where id=$id";

$del_rs=$db->delete_data($del_msg);

if($del_rs>0)
{
//-------------------------- Insert into COINS system --------------------------------

$post_photo_comment = 6;

// select $friend_request category

$sql = "SELECT * FROM sc_coins_type WHERE id = $post_photo_comment";

$c_t =$db->select_data($sql);



if($c_t[0][disable]!=1)

{

$sql_coins1 = "UPDATE sc_member set coins_sum=coins_sum -".$c_t[0][price]." where scm_mem_id = $social_mem_id";

$db->update_data($sql_coins1);





$time_=time();

$sql_c = "INSERT INTO sc_coins_asset (`type_id`,`mem_id`,`from/to_mem_id`,`date_added`,`value`) VALUES($post_photo_comment,$social_mem_id,$scm_mem_id,'".$time_."',-".$c_t[0][price].")";

$db->insert_data($sql_c);

}

//echo $sql_c;

//exit();

//----------------------------------------------------------------------------------//
}



//header("location:social_mem_see_mess.php?sci_id=$sci_id&scm_mem_id=$social_mem_id");

}



?>
[/code]
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.