Data truncated for column





First time I got this error Data truncated for column. I’m using mysql version 5 and I got a simple query like this:





$val1= 1;
$val2 = 3;
INSERT INTO TBL(‘val1′, ‘val2′) VALUES ($val1, $vall2);
Notice the variable name for $val2 in the query?  I fixed the variable name to $val2 and problem solved.
I really don’t know what causes this but that solves my problem.

I also notice on mysql 5 it returns an error ‘data type’ when let say I got a field that’s integer and upon saving the variable value for that is empty.

This entry was posted in mysql and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>