• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Gesior shop system rep+

davidgiosa

New Member
Joined
Jan 27, 2010
Messages
15
Reaction score
0
Location
Italy
hello

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>';
										}
 
When data is truncated it basically means that the text was too long to fit so PHP had to strip it down by removing any additional characters (after the limit that is).

Most likely the $buy_offer['name'] variable should contain the ID for the offer, and not its name.
 
Back
Top Bottom