How to solved column error in php | Out of range value adjusted for column error in php

To avoid this error Out of range value adjusted for column there are possible three solutions but I prefer solution 1 and solution 2.

Solution 1

Use functionality of SQL_MODE

Just Login to the mysql shell and use this command to avoid the error

SET GLOBAL SQL_MODE=”;

It will fix your problem.

Solution 2

Modification in insert query

Sometimes our website hosting company (incase if website is hosted by website hosting company) doesn’t give us permission to use SQL_MODE or sometimes we want to quicker solve this error without contacting the hosting company of our website then use insert query like this

$sql="insert into student values('Adeel', 'Fakhar')";

Instead of $sql="insert into student values('', 'Adeel', 'Fakhar')";

0 comments:

Post a Comment