arn_php Posted February 26, 2008 Share Posted February 26, 2008 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 Quote Link to comment Share on other sites More sharing options...
php_dave Posted February 26, 2008 Share Posted February 26, 2008 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 Quote Link to comment Share on other sites More sharing options...
arn_php Posted February 26, 2008 Author Share Posted February 26, 2008 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? Quote Link to comment Share on other sites More sharing options...
rocketeerbkw Posted February 26, 2008 Share Posted February 26, 2008 In response to the PM you sent me referring to this topic, when I referred to strict mode, I meant in MySQL. Not sure how it works in mysql 5 now, but google can help you better than I. Quote Link to comment Share on other sites More sharing options...
php_dave Posted February 26, 2008 Share Posted February 26, 2008 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 Quote Link to comment Share on other sites More sharing options...
aschk Posted February 26, 2008 Share Posted February 26, 2008 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. Quote Link to comment Share on other sites More sharing options...
luca200 Posted February 26, 2008 Share Posted February 26, 2008 This is a known bug in mysql 5.0 Bug?!?! Quote Link to comment Share on other sites More sharing options...
aschk Posted February 26, 2008 Share Posted February 26, 2008 No bug... feature! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.