mcmuney Posted December 11, 2006 Share Posted December 11, 2006 I'm using the following code to write to the database and I'm specifying $to and $amount on the url, but it always writes 2 of each line. It should normally write 3 lines, but it's writing 6. What am I missing:[code]<? if ($_SESSION['social_mem_id']==1) { echo "<font class=text><b>Enter to=$to and amount=$amount values!</font>"; if ($to!="") { if ($amount!="") { //-------------------------- Insert into COINS system -------------------------------- $rom_citation = 9; $c_t=array(); $sql = "SELECT * FROM sc_coins_type WHERE id =".$rom_citation; $c_t =$db->select_data($sql); if($c_t[0][disable]!=1) { $sql_coins = "UPDATE sc_member set coins_sum=coins_sum -".$amount." where scm_mem_id = $to"; $db->update_data($sql_coins); $time_=time(); $sql_c = "INSERT INTO sc_coins_asset (`type_id`,`mem_id`,`from/to_mem_id`,`date_added`,`value`) VALUES($rom_citation,$to,8,'".$time_."',-".$amount.")"; $db->insert_data($sql_c); $sql="INSERT INTO `sc_messages` (`smg_from`, `smg_to`, `smg_subject`, `smg_body`, `smg_postdate`,`smg_block` ) VALUES ('8','$to','ROM Citation','You have been cited $amount gold coins!','$time','0')"; $db->insert_data($sql); echo "<br><br><font class=text color=red>Deducted!!!</font>"; } } } }?>[/code] Quote Link to comment Share on other sites More sharing options...
btherl Posted December 11, 2006 Share Posted December 11, 2006 Are you sure your entire script isn't being run twice? Are you able to check your request logs to see if it's happening? Quote Link to comment Share on other sites More sharing options...
mcmuney Posted December 11, 2006 Author Share Posted December 11, 2006 I don't see how, this is the whole script, I just can't figure out why or how it's running twice. 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.