CREATE TABLE IF NOT EXISTS `roster_currency` (
`member_id` int(10) unsigned NOT NULL default '0',
`catagory` varchar(255) NOT NULL default '',
`name` varchar(255) NOT NULL default '',
`icon` varchar(255) default NULL,
`tooltip` varchar(255) default NULL,
`count` varchar(255) NOT NULL default '0',
`type` varchar(255) default '',
PRIMARY KEY (`member_id`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
function do_currency( $memberId, $data )
{
global $roster;
$currency = $data['Currency'];
$messages = '<li>Updating Currency';
$querystr = "SELECT * FROM `" . $roster->db->table('currency') . "` WHERE `member_id` = '$memberId' ";
//echo $querystr.'<br>';
$result = $roster->db->query($querystr);
if( !$result )
{
$this->setError('Cannot select Companion Data',$roster->db->error());
return;
}
if( $roster->db->num_rows( $result ) >= 1 )
{
$update = true;
}
else
{
$update = false;
}
//$this->reset_values();
foreach ($currency as $type => $info)
{
foreach ($info as $inf => $in)
{
//echo ''.$type.' - '.$in['Type'].'- '.$in['Name'].'- '.$in['Tooltip'].'- '.$in['Count'].' (*)<br>';
$this->reset_values();
$querystr = "SELECT * FROM `" . $roster->db->table('currency') . "` WHERE `name` = '".addslashes($in['Name'])."' and `member_id` = '$memberId' ";
//echo $querystr.'<br>';
$result = $roster->db->query($querystr);
if( !$result )
{
$this->setError('Cannot select Companion Data',$roster->db->error());
return;
}
if( $roster->db->num_rows( $result ) == 1 )
{
$update = true;
}
else
{
$update = false;
}
$this->add_value( 'member_id', $memberId );
$this->add_value( 'type', $in['Type'] );
$this->add_value( 'catagory', $type );
$this->add_value( 'name', addslashes($in['Name']) );
//$this->add_value( '', $id );
$this->add_value( 'count', $in['Count'] );
if( !empty($in['Tooltip']) )
{
$this->add_value( 'tooltip', $in['Tooltip'] );
}
//$this->add_value( '', $data['CreatureID'] );
if( !empty($in['Icon']) )
{
$this->add_value('icon', $this->fix_icon($in['Icon']) );
}
$messages .= '.';
if( $update )
{
$querystr = "UPDATE `" . $roster->db->table('currency') . "` SET " . $this->assignstr . " WHERE `member_id` = '$memberId' and `name` = '".addslashes($in['Name'])."'";
$result = $roster->db->query($querystr);
}
else
{
$querystr = "INSERT INTO `" . $roster->db->table('currency') . "` SET " . $this->assignstr;
$result = $roster->db->query($querystr);
}
if( !$result )
{
$this->setError('Cannot update Currency Data',$roster->db->error());
return;
}
}
}
$this->setMessage($messages . '</li>');
}
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Shard' and `member_id` = '15'' at line 1
SQL:
SELECT * FROM `roster_currency` WHERE `name` = 'Stone Keeper's Shard' and `member_id` = '15'
File: lib/dbal/mysql.php
Line: 234
Return to General Support & Feedback
Users browsing this forum: No registered users and 1 guest