mysql error is occurd while inserting data..........

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

mysql error is occurd while inserting data..........

Post by manojsemwal1 »

hai iam using mysql 5.0 vresion and when i insert data in table its display error.
query are
insert into anntb values('','fdsaf','dsafdsfs','on','2010-02-03 15:27:39');
Out of range value adjusted for column 'announceid' at row 1

while when i insert data through querybrowser that time data is insert into table with the error but through programe its not inserting................


Thannks
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: mysql error is occurd while inserting data..........

Post by social_experiment »

It looks like you are inserting an empty string into an integer field [sic]. Maybe check out the url i posted.

Code: Select all

<?php insert into anntb values('','fdsaf','dsafdsfs','on','2010-02-03 15:27:39'); ?>

Code: Select all

<?php
    insert into products_notifications (products_id, customers_id, date_added) values (”, ‘2?, now())
 
   /* In the above query, the error was thrown for ‘products_id’ because products_id is an integer field and the programmer was trying to      insert an empty string into it.*/
?>
 
http://webomania.wordpress.com/2006/10/ ... umn-error/
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: mysql error is occurd while inserting data..........

Post by manojsemwal1 »

yes actually that id is autoincrement value and in database so i left blank.
Post Reply