|
|
|
| Подскажите, пожалуйста где тут ошибка?
Вылазит ошибка: MySQL error: Column count doesn't match value count at row 1
INSERT INTO pay_outcomming(userid, payvariant, paycost, paycount, date, status, comments, purchase_id)
VALUES('1', 'balance', 360, 90, NOW(), 1, 'Покупка ставок', 0, 'paypacket')
<?php
class balance extends APayments implements IPayment, IPaymentCallback {
public $pay_name = "С личного баланса";
public function getBuyForm($options) {
global $sql, $translator, $user_info;
if ($user_info['balance']<$options['amount'])
return "Error:".$translator->_('insufficient_funds').
"<br /><br />".
"<a href='/my/balance/'>".$translator->_('replenish')."</a>";
else {
$pay_info = array('userid'=>$_SESSION['ID'], 'payvariant'=>'balance', 'paycost'=>$options['amount'], 'paycount'=>$options['count'], 'comments'=>$options['desc'], 'purchase_id'=>$options['purchase_id'], 'type'=>$options['type']);
$sql->exec("INSERT INTO pay_outcomming(userid, payvariant, paycost, paycount, date, status, comments, purchase_id)
VALUES('{$pay_info['userid']}', '{$pay_info['payvariant']}', {$pay_info['paycost']}, {$pay_info['paycount']}, NOW(), 1, '{$pay_info['comments']}', {$pay_info['purchase_id']}, '{$pay_info['type']}')");
$sql->exec("UPDATE users SET balance=balance-{$pay_info['paycost']} WHERE id={$pay_info['userid']}");
makeOrder($pay_info);
return "<form name='pay' action='/article/success.html'></form>";
}
}
public function process() {}
public function isCallback() {
return false;
}
}
?>
|
| |
|
|
|
|
|
|
|
для: dsl97
(01.11.2016 в 22:28)
| |
INSERT INTO pay_outcomming (
userid,
payvariant,
paycost,
paycount,
date,
status,
comments,
purchase_id
)
VALUES (
'1',
'balance',
360,
90,
NOW(),
1,
'Покупка ставок',
0,
'paypacket'
)
|
Перечислено 8 столбцов, вставляется 9 значений.
Об этом говорится в тексте ошибки - не совпадает... | |
|
|
|
|