• Hello,

    When i tried to upload an image to the post this is the error I got.

    Please Help

    WordPress database error Out of range value adjusted for column ‘post_parent’ at row 1 for query INSERT INTO wp_posts (post_author,post_date,post_date_gmt,post_content,post_content_filtered,post_title,post_excerpt,post_status,post_type,comment_status,ping_status,post_password,post_name,to_ping,pinged,post_modified,post_modified_gmt,post_parent,menu_order,post_mime_type,guid) VALUES (‘1′,’2009-08-10 12:54:27′,’2009-08-10 18:54:27′,”,”,’iadc_logo’,”,’inherit’,’attachment’,’open’,’open’,”,’iadc_logo’,”,”,’2009-08-10 12:54:27′,’2009-08-10 18:54:27′,’-1249929892′,’0′,’image/gif’,’http://drillingcontractor.org/home/wp-content/uploads/2009/08/iadc_logo1.gif’) made by do_action, call_user_func_array, media_upload_image, media_handle_upload, wp_insert_attachment

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m getting the same error, periodically. Nine times out of ten, I receieve this error when attempting to post an image. The other one time I attempt this, it works great.

    Running WordPress 2.8.4, on Win 2003 Server with Service Pack 2 installed, PHP 5, and IIS 6.0 with all current security updates.

    Any ideas on this?

    Thanks!

    Hi,

    Have a check with these options:

    -> Assign 766 recursive permissions to wp-contents folder of your blog.
    -> make sure that you have set the proper upload path in wordpress admin area.
    -> disable all the plugins and enable it one by one to find out the culprit one.
    -> remove all unwanted code from htaccess file.
    -> upgrade your wordpress to the latest version

    Thanks,

    Shane G.

    As far I know the value for post_parent should be integer (datatype of post_parent filed is bigint). In you case, it is trying to insert “-1249929892” value. I am not sure why it is trying to insert this value but if I find any solution I will post it here.

    Kailash

    Shane:

    -> Assign 766 recursive permissions to wp-contents folder of your blog.
    -> make sure that you have set the proper upload path in wordpress admin area.
    -> disable all the plugins and enable it one by one to find out the culprit one.
    -> upgrade your wordpress to the latest version

    I’ve done all of these items on my installation, and the problem is occurring without any plugins installed. I am running the most current version of WordPress.

    -> remove all unwanted code from htaccess file.

    I wasn’t sure exactly what you meant by this, could you elaborate a bit?

    Thanks.

    Is anyone else experiencing this problem?

    Hello, I am new at wordpress but do some PHP/MySQL and I found the answer to this error, in fact when this error appear you can’t insert image into post as once you click “upload” button nothing happend, I saw a lot of posts about thos two porblems that seems to be linked, but strangely, when I do a quick post I can insert an image.

    Solution to your problem is simple but I can’t explain if it is a bug in WP or in MySQL Table declaration.

    Go to “wp_posts” table uqing any MySQL database manager and change ‘post_parent” that is bigint(20) unsigned to signed so when you try to insert picture that make WP produce a negative parent ID, value will be accepted.

    I can’t tell you if negative value produced by WP is a bug or not, but thinking of it it should not produce negative as field’s name is “post_parent” so should be a parent’s post ID that should be positive numbers.

    I cannot tell you if my fix is “clean” but it worked for me.

    Edit : I found a german thread about same problem and I think I was not wrong changing to “signed”, but the post say the problem is because of “strict” mode used by MYSQL 5 and propose an other approach by adding this small code instead of changing database structure :

    In function “__construct” inside “wp-includes/wp-db.php”

    find this line :

    if (!$this->dbh) {

    and add this after it :

    $mysql_version=trim(mysql_get_server_info());
    if (substr($mysql_version,0,1)>’4′)
    {
    //Disable “STRICT” mode for MySQL 5!
    $this->query(“SET SESSION sql_mode=””);
    }

    regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ERROR While Uploading an image to the post’ is closed to new replies.