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
https://forums.phpfreaks.com/topic/30207-writing-duplicate-lines/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.