Jump to content

PDO Help -> Incorrect Integer Value


Gaia

Recommended Posts

Hi,

 

Not sure if this is really MySQL related or PHP related, sorry if I am posting in the wrong spot!

 

I have a PHP application that uses PDO FrameWork.  I have moved it to another web server and now I am having a bit of trouble.

 

Here is the MySQL query:

 

$query = $db->prepare("INSERT INTO entries VALUES ('','$admin', '$admin_ip', '$nickname', '$nick_ip', '$date', '$reason', '$action','','','','','','','$is_dup')");	
$query->execute();

 

The first value is 'id' and is, of course, set to auto_increment.  However, PDO is not allowing the value to be empty for some reason. It is throwing out the following error:

 

Array ( [0] => HY000 [1] => 1366 [2] => Incorrect integer value: '' for column 'id' at row 1 )

 

As far as I know the auto increment field is supposed to be empty/null ?

 

Anyone have any insight on this? Would this perhaps be something caused by MySQL 5.0? I believe the last server was running MySQL 4.1.x but I think the new server is running MySQL 5.x

 

Much thanks in advanced.

Link to comment
https://forums.phpfreaks.com/topic/90601-pdo-help-incorrect-integer-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.