Jump to content

PDO Help -> Incorrect Integer Value


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.