mcmuney Posted November 8, 2006 Share Posted November 8, 2006 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] Quote Link to comment Share on other sites More sharing options...
btherl Posted November 9, 2006 Share Posted November 9, 2006 What are the symptoms? How do you know it's being written twice? And what happens if you print something out straight after the function is called? Quote Link to comment 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.