davidgiosa
New Member
hello
i try buy itens and receive this error
here this line 480
i try buy itens and receive this error
Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[01000]: Warning: 1265 Data truncated for column 'offer_id' at row 1' in C:\xampp\htdocs\shopsystem.php:480 Stack trace: #0 C:\xampp\htdocs\shopsystem.php(480): PDO->query('INSERT INTO `z_...') #1 C:\xampp\htdocs\index.php(195): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\shopsystem.php on line 480
here this line 480
Code:
elseif($buy_offer['type'] == 'item') {
Plx i Need help
$sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', \'\', \'\', \'item\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
$SQL->query($sql);
$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
$SQL->query($save_transaction);
$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
$user_premium_points = $user_premium_points - $buy_offer['points'];
$main_content .= '<center><h2>Item added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br>Now you have <b>'.$user_premium_points.' premium points</b>.<br><br><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a><br>';
}