Home What wrong on my code with PDO insert to mysql
Reply: 0

What wrong on my code with PDO insert to mysql

user915
1#
user915 Published in August 15, 2018, 9:02 am

I try insert data to database but i always got error

$insertTransaction = $odb->prepare("INSERT INTO `cq9_transactions` VALUES(NULL, :userId, :actionType, :account, :createTime, :endTime, :statusTxt, :statusMessage, :beforeBalance, :afterbalance, :currencyCode, :eventJSON, :createdAt, NULL)");
$insertTransaction->execute(array(':userId' => 1, ':actionType' => 'takeall', ':account' => 'admin', ':createTime' => getDateTime(), ':endTime' => getDateTime(), ':statusTxt' => 'success', ':statusMessage' => 'success', ':beforeBalance' => '1', ':afterBalance' => '1', ':currencyCode' => 'CNY', ':eventJSON' => '1', ':createdAt' => serverDateTime()));

Error Message: Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in C:\xampp\htdocs\cq9-api\public\index.php on line 120

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30235 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO