Jump to content

Writing Duplicate Lines


mcmuney

Recommended Posts

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]
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.