ok now i have no sql errors and it goes through all the motions. still a problem though. it doesn't mail the items properly...
Code:
foreach($Items as $key => $value)
{
$ccon = mysql_connect($Realms[(int)$value['realm']]['sqlhost'],$Realms[(int)$value['realm']]['sqluser'],$Realms[(int)$value['realm']]['sqlpass'],true);
mysql_select_db($Realms[(int)$value['realm']]['chardb'],$ccon);
$REWARDNAME = mysql_real_escape_string($Rewards[$value['id']]['name'],$ccon);
if((int)$Rewards[$value['id']]['item1'] > 0)
{
mysql_query("INSERT INTO mailbox_insert_queue VALUES ('{$value['character']}','{$value['character']}','".MAIL_SUBJECT."','".MAIL_BODY."','61','0','".$Rewards[(int)$value['id']]['item1']."','1')");
}
if((int)$Rewards[$value['id']]['item2'] > 0)
{
mysql_query("INSERT INTO mailbox_insert_queue VALUES ('{$value['character']}','{$value['character']}','".MAIL_SUBJECT."','".MAIL_BODY."','61','0','".$Rewards[(int)$value['id']]['item2']."','1')");
}
if((int)$Rewards[$value['id']]['item3'] > 0)
{
mysql_query("INSERT INTO mailbox_insert_queue VALUES ('{$value['character']}','{$value['character']}','".MAIL_SUBJECT."','".MAIL_BODY."','61','0','".$Rewards[(int)$value['id']]['item3']."','1')");
}
if((int)$Rewards[$value['id']]['gold'] > 0)
{
mysql_query("INSERT INTO mailbox_insert_queue VALUES ('{$value['character']}','{$value['character']}','".MAIL_SUBJECT."','".MAIL_BODY."','61','".$Rewards[$value['id']]['gold']."','0','0')");
}
mysql_close($ccon);
}
i don't have a mailbox_insert_queue table. i do have two different tables, mail and mail_items.
neither of which follow the format that the code suggests. it seems to seperate the mail from the items in the mail, and it also doesn't use the character's name, but uses the character's id. i'm so very confused. any ideas on how to resolve this?
im using Reaper-X Trinity Core 595