Warning: # 1265 Data truncuted for column 'cart_ip' at row 1.
I wanted to add ip 127.0.0.1 to this entry since I work on a local machine and there is an error here. What could be the problem?
Warning: # 1265 Data truncuted for column 'cart_ip' at row 1.
I wanted to add ip 127.0.0.1 to this entry since I work on a local machine and there is an error here. What could be the problem?
The fact is that you specified the length of the cart_ip column less than you are trying to insert. For example, it may have been declared as varchar(6) , but should be 15.
Accordingly, it is necessary to hold ALTER TABLE and change the length of the column to the desired one. For more.
Example:
ALTER TABLE myTable CHANGE cart_ip cart_ip VARCHAR(15); Yes, no, I have an int (100)
So especially for ip, you need to change the field type. For the string of chars in int does not fit, however.
To store IP in DB as a number, you need to convert it with the help of INET_ATON , which is basically more correct than storing the string. You can read more here.
Source: https://ru.stackoverflow.com/questions/597046/
All Articles