Strohi
11-12-2009, 01:02 AM
Hi everyone,
I'd like to change the original "Lord of the Rings" template with the implementation of a SKS-LootSytem.
I'm nearly ready to finish that project.
But now I've the last Error, i can't handle:
After the Main-Looter gets his stuff, all others should get points for assisting the raid.
The code shows me the signedup raiders, an without the [Update] sql-function, the print error show me x times the value, as desired.
But if i try to write the datas back to the database, the function will stop after the first one?
I know my english is not quite good, but I hope everybody understand the problem.
Here ist the part of the code:
$sql['SELECT'] = 'c.*,s.*';
$sql['FROM'] = array('character c','signups s');
$sql['WHERE'] = 's.raid_id='.$raid_id.' AND c.Character_ID=s.character_id';
$db_raid->set_query('select', $sql, __FILE__, __LINE__);
while($data = $db_raid->fetch()) {
$db_char_id = $data['character_id'];
$db_rue_old = $data['list_ruestung'];
$db_waf_old = $data['list_waffen'];
$db_sch_old = $data['list_schmuck'];
$db_rue_neu = $db_rue_old - $tw;
$db_waf_neu = $db_waf_old - $tw;
$db_sch_neu = $db_sch_old - $tw;
// Neuwerte Eintragen(teilnahmebonus)
$sql['UPDATE'] = 'character';
$sql['VALUES'] = array(
'list_ruestung' => $db_rue_neu,
'list_waffen' => $db_waf_neu,
'list_schmuck' => $db_sch_neu);
$sql['WHERE'] = 'character_id='.$db_char_id;
$db_raid->set_query('update', $sql, __FILE__, __LINE__);
printError("Die anderen: ".$db_char_id."Raidover: ".$raidover." / DB Rue Neu: "
.$db_rue_neu."/ Alt: ".$db_rue_old." / TN: ".$tw." Werte: ".$db_rue_neu." / "
.$db_waf_neu." / ".$db_sch_neu);
}
I'd like to change the original "Lord of the Rings" template with the implementation of a SKS-LootSytem.
I'm nearly ready to finish that project.
But now I've the last Error, i can't handle:
After the Main-Looter gets his stuff, all others should get points for assisting the raid.
The code shows me the signedup raiders, an without the [Update] sql-function, the print error show me x times the value, as desired.
But if i try to write the datas back to the database, the function will stop after the first one?
I know my english is not quite good, but I hope everybody understand the problem.
Here ist the part of the code:
$sql['SELECT'] = 'c.*,s.*';
$sql['FROM'] = array('character c','signups s');
$sql['WHERE'] = 's.raid_id='.$raid_id.' AND c.Character_ID=s.character_id';
$db_raid->set_query('select', $sql, __FILE__, __LINE__);
while($data = $db_raid->fetch()) {
$db_char_id = $data['character_id'];
$db_rue_old = $data['list_ruestung'];
$db_waf_old = $data['list_waffen'];
$db_sch_old = $data['list_schmuck'];
$db_rue_neu = $db_rue_old - $tw;
$db_waf_neu = $db_waf_old - $tw;
$db_sch_neu = $db_sch_old - $tw;
// Neuwerte Eintragen(teilnahmebonus)
$sql['UPDATE'] = 'character';
$sql['VALUES'] = array(
'list_ruestung' => $db_rue_neu,
'list_waffen' => $db_waf_neu,
'list_schmuck' => $db_sch_neu);
$sql['WHERE'] = 'character_id='.$db_char_id;
$db_raid->set_query('update', $sql, __FILE__, __LINE__);
printError("Die anderen: ".$db_char_id."Raidover: ".$raidover." / DB Rue Neu: "
.$db_rue_neu."/ Alt: ".$db_rue_old." / TN: ".$tw." Werte: ".$db_rue_neu." / "
.$db_waf_neu." / ".$db_sch_neu);
}