Jump to content

Out of range value adjusted for column


arn_php

Recommended Posts

I am moving to a php5.1.2 and mysql5.0.20.

I have my register_globals ON but then I got this error message:

--------------------------------------------------------------------------------

ERROR DETAILS :ERROR :: LIB_EXTRANET_FORM - MANAGE_SAVE - QUERY

Out of range value adjusted for column 'field_display_order' at row 1

Query :: UPDATE edub_infob SET name='My name',phone='123.456.7890',ext='123',fax='123.456.7890',email='name@domain.com',flag_status='1',field_display_order='' WHERE infob_id = '1';

I do understand that the field_display_order is empty, but how do I fix it? I am using a custom cms with code like this:

function generate_url_parameters($new_parameters, $generate_type = 'update', $ignore_parameters = array()){

$url_string = '';

if($generate_type == 'update'){

//let's first parse the existing parameters

foreach($_GET as $array_key=>$array_val){

if ( isset($array_val) && ($array_val >= 0) && !isset($new_parameters[$array_key]) && !in_array($array_key, $ignore_parameters) ){

//if the value is not banned we use it

$url_string .= '&'.$array_key.'='.$array_val;

}

}

}

//let's parse the new parameters

if(count($new_parameters) > 0){

foreach($new_parameters as $array_key=>$array_val){

if ( isset($new_parameters[$array_key]) && ($new_parameters[$array_key] >= 0)){

//if the new value is provided we use that value

$url_string .= '&'.$array_key.'='.$new_parameters[$array_key];

}

}

}

return substr($url_string, 1);

}

 

Before, i was using php4.4.8 and mysql4.1.21 and I never got the error.  The field_display_order should filled automatically (when I edit the entry) as well as the infob_id when I add an entry.  But with this php5.1.2 and mysql5.0.20, either I try to modify an entry or add a new one, the (similar) error shows up saying that

Out of range value adjusted for column 'field_display_order' at row 1 or

Out of range value adjusted for column 'infob_id ' at row 1.

Why ? Any help are welcome, please. 

 

Thanks,

 

Arnold

 

Link to comment
Share on other sites

Hey Arnold,

 

This is a known bug in mysql 5.0 that is to do with the rounding of a char value into an int field in mysql (or a blank value as you are passing).

 

You can fudge the data in by doing the following:

 

In the mysql shell type SET GLOBAL SQL_MODE = ''

 

Be warned though this removes all restrictions and checks on bad data and will update MYSQL regardless - but to be honest I now develop in such a way to validate my data before it is passed to the DB and have been running with SQL MODE at '' since release.

 

SQL_MODE can also be set in the my.ini file as well.

 

Hope this helps

 

Cheers

Dave

 

 

Link to comment
Share on other sites

Thanks Dave, but I am still confuse with your explanation. Sorry for my lack of knowledge.

 

In the mysql shell type SET GLOBAL SQL_MODE = ''

Where can I access this? php.ini (apache config?)

 

SQL_MODE can also be set in the my.ini file as well. ?? Is this within the apache too?

Link to comment
Share on other sites

Thanks Dave, but I am still confuse with your explanation. Sorry for my lack of knowledge.

 

In the mysql shell type SET GLOBAL SQL_MODE = ''

Where can I access this? php.ini (apache config?)

 

SQL_MODE can also be set in the my.ini file as well. ?? Is this within the apache too?

 

Hey Arn,

 

No problem you can access the shell by typing mysql -u <username> -p <password>  from the command prompt (be it dos or bash) and then execute that SET Global command but it is probably better to change the setting within the my.ini file - this is nothing to do with apache but is found on the root directory of your MYSQL install - for example i installed mysql to this area -  D:\webhosting\MYSQL 5.0\  and the my.ini would be located at that level.

 

Cheers

Dave

 

Link to comment
Share on other sites

It'll be the PHP script throwing up that error from MySQL, but it points to the fact that you're not passing in what it wants/requires.

Guessing that this is an off the shelf product, you need to supply the "field_display_order" and "infob_id" in your GET string, or the form you're passing it from, and give it some acceptable parameters.

Link to comment
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.