Postado Setembro 25, 2017 7 anos Olá a todos, quando testei o shop system no localhost antes de colocar no dedicado estava tudo Ok. Na verdade ele está funcionando. O problema é que quando compra o item, cai na página de erro, o item chega pro player mas não desconta Donation Points. para vip days funciona, para items não. ERRO: Citar Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6' for key 1' in C:\xampp\htdocs\shopsystem.php:493 Stack trace: #0 C:\xampp\htdocs\shopsystem.php(493): PDO->query('INSERT INTO `z_...') #1 C:\xampp\htdocs\index.php(320): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\shopsystem.php on line 493 To meio confuso, alguém pode ajudar?
Postado Setembro 25, 2017 7 anos Olá a todos, quando testei o shop system no localhost antes de colocar no dedicado estava tudo Ok. Na verdade ele está funcionando. O problema é que quando compra o item, cai na página de erro, o item chega pro player mas não desconta Donation Points. para vip days funciona, para items não. ERRO: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6' for key 1' in C:\xampp\htdocs\shopsystem.php:493 Stack trace: #0 C:\xampp\htdocs\shopsystem.php(493): PDO->query('INSERT INTO `z_...') #1 C:\xampp\htdocs\index.php(320): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\shopsystem.php on line 493 To meio confuso, alguém pode ajudar?Gesior? Ativa o debug e me mostra essa query completaEnviado de meu MI 5s usando Tapatalk Em Desenvolvimento Tutoriais: [PagSeguro] Novo Método de Retorno Automático
Postado Setembro 25, 2017 7 anos Autor 13 minutos atrás, Ivens Pontes disse: Gesior? Ativa o debug e me mostra essa query completa Esse é o insert da table -- -- Estrutura da tabela `z_shop_offer` -- CREATE TABLE `z_shop_offer` ( `id` int(11) NOT NULL auto_increment, `points` int(11) NOT NULL default '0', `itemid1` int(11) NOT NULL default '0', `count1` int(11) NOT NULL default '0', `itemid2` int(11) NOT NULL default '0', `count2` int(11) NOT NULL default '0', `offer_type` varchar(255) default NULL, `offer_description` text NOT NULL, `offer_name` varchar(255) NOT NULL, `pid` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=12698 ; O insert dos items -- -- Extraindo dados da tabela `z_shop_offer` -- INSERT INTO `z_shop_offer` (`id`, `points`, `itemid1`, `count1`, `itemid2`, `count2`, `offer_type`, `offer_description`, `offer_name`, `pid`) VALUES (12656, 10, 8927, 1, 0, 0, 'itemvip', '>> Attack: 90 <<\r\n>> Deffense:30 <<\r\n>> Skill Club +10 <<\r\nPara Knights', 'VIP CLUB', 0), (12657, 10, 8925, 1, 0, 0, 'itemvip', '>> Attack: 90 <<\r\n>> Deffense:30 <<\r\n>> Skill Axe +10 <<\r\nPara Knights', 'VIP AXE', 0), (12658, 10, 7429, 1, 0, 0, 'itemvip', 'Vip STAFF - 400 a 500 em monsters.\r\nPara Sorcerers e Druids', 'VIP STAFF', 0), (12655, 10, 8931, 1, 0, 0, 'itemvip', '>> Attack: 90 <<\r\n>> Deffense:30 <<\r\n>> Skill Sword +10 <<\r\nPara Knights', 'VIP SWORD', 0), (12687, 7, 12646, 1, 0, 0, 'item', 'Regenera Mana e Life 150/150 Por Turno\r\nArmor:10\r\nSpeed +40', 'VIP Knight Boots', 0), (12660, 10, 2357, 1, 0, 0, 'itemvip', 'Heal Mana e Life 100/100\r\nSpeed +40\r\nProtection All +15%', 'Vip Ring', 0), (12661, 5, 8849, 1, 0, 0, 'itemvip', 'Atk+50\r\nChance 100%\r\nRange 10\r\nDistance +10\r\nCombinado com Vip Arrow', 'VIP CROSSBOW', 0), (12662, 5, 2196, 1, 0, 0, 'itemvip', 'Aol Infinito\r\nSpeed +40\r\nProtection All +15%', 'Vip Amulet', 0), (12664, 10, 0, 30, 0, 0, 'pacc', 'VIP 30 Dias Na sua Conta\r\n<a href="?subtopic=beneficiospremium">Vantagens Vips</a>', 'VIP 30 DAYS', 0), (12665, 7, 8904, 1, 0, 0, 'item', 'Deffense:30\r\nMagic level +10\r\nPara Druids e Sorcerers', 'VIP Spellbook', 0), (12686, 7, 12643, 1, 0, 0, 'item', 'Armor:20\r\nTodos Skills Axe,Sword,Club +10\r\nProtect All +5%', 'VIP Knight Legs', 0), (12667, 3, 8702, 1, 0, 0, 'itemvip', 'Recupera Toda Sua Stamina', 'Book Of Stamina', 0), (12669, 10, 0, 0, 0, 0, 'changename', 'Troca Seu Nome', 'Change Name', 0), (12671, 7, 0, 15, 0, 0, 'pacc', 'VIP 15 Dias Na sua Conta\r\n<a href="?subtopic=beneficiospremium">Vantagens Vips</a>', 'VIP 15 DAYS', 0), (12672, 3, 9693, 1, 0, 0, 'item', 'Escolha um addon full\r\nExemplo !addon Citizen', 'Addon Doll', 0), (12673, 5, 2352, 1, 0, 0, 'itemvip', 'Vip arrow Combinada com vip bow, Atk 90 Hitchance: 100%', 'Vip Arrow', 0), (12688, 7, 6433, 1, 0, 0, 'item', 'Defende:70\r\nTodos skills Axe,Club e Sword +10', 'VIP Knight Shield', 0), (12684, 7, 2343, 1, 0, 0, 'item', 'Armor:20\r\nTodos Skills Axe,Sword,Club +10', 'VIP Knight Helmet', 0), (12685, 7, 9776, 1, 0, 0, 'item', 'Armor:20\r\nTodos Skills Axe,Sword,Club +10\r\nProtege contra todos os danos +5%', 'VIP Knight Armor', 0), (12678, 10, 0, 0, 0, 0, 'redskull', 'Remove Red Skull Your Character', 'Remove Skull', 0), (12689, 7, 12645, 1, 0, 0, 'item', 'Armor:20\r\nSkill Distance +10', 'VIP Paladin Helmet', 0), (12690, 7, 12642, 1, 0, 0, 'item', 'Armor:20\r\nProtege contra todos os danos +6%\r\nSkill Distance +10', 'VIP Paladin Armor', 0), (12691, 7, 9777, 1, 0, 0, 'item', 'Armor:20 Protege contra todos os danos +6% Skill Distance +10', 'VIP Paladin Legs', 0), (12692, 7, 9931, 1, 0, 0, 'item', 'Regenera Mana e Life 150/150 Por Turno \r\nArmor:10 Speed +40', 'VIP Paladin Boots', 0), (12693, 7, 12644, 10, 0, 0, 'item', 'Defende:70\r\nSkill Distance +10', 'VIP Paladin Shield', 0), (12694, 7, 9778, 1, 0, 0, 'item', 'Armor:20\r\nProtege contra todos os danos +6%\r\nMagic level +10', 'VIP Mage Helmet', 0), (12695, 7, 8865, 1, 0, 0, 'item', 'Armor:20\r\nProtege contra todos os danos +6%\r\nMagic Level +10', 'VIP Mage Cape', 0), (12696, 7, 11304, 1, 0, 0, 'item', 'Armor:20\r\nProtege contra todos os danos +6%\r\nMagic Level +10', 'VIP Mage Legs', 0), (12697, 7, 2358, 1, 0, 0, 'item', 'Regenera Mana e Life 150/150 Por Turno Armor:10 Speed +40', 'VIP Mage Boots', 0); E como está na liinha do Shopsystem.php indicada pelo erro elseif($buy_offer['type'] == 'item') { $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>'; } E o erro após selecionar o char que irá receber o item e clicar Confirmar Citar Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9' for key 1' in C:\xampp\htdocs\shopsystem.php:493 Stack trace: #0 C:\xampp\htdocs\shopsystem.php(493): PDO->query('INSERT INTO `z_...') #1 C:\xampp\htdocs\index.php(320): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\shopsystem.php on line 493 OBSERVAÇÃO IMPORTANTE A cada vez que eu compro um item aumentar o entry... Duplicate entry '9' for key 1' Se eu comprar o item denovo fica Duplicate entry '10' for key 1' Editado Setembro 25, 2017 7 anos por lucasprimolemos (veja o histórico de edições)
Postado Setembro 25, 2017 7 anos OBSERVAÇÃO IMPORTANTE A cada vez que eu compro um item aumentar o entry... Duplicate entry '9' for key 1' Se eu comprar o item denovo ficaDuplicate entry '10' for key 1' Queria ver a query, os dados que tão indo junto com o código, coloca debug lá no index.php Enviado de meu MI 5s usando Tapatalk Em Desenvolvimento Tutoriais: [PagSeguro] Novo Método de Retorno Automático
Postado Setembro 25, 2017 7 anos Autor 3 minutos atrás, Ivens Pontes disse: Queria ver a query, os dados que tão indo junto com o código, coloca debug lá no index.php Enviado de meu MI 5s usando Tapatalk Desculpa minha falta de conhecimento, mas como coloco o Debug no index.php?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.