Support » Fixing WordPress » Errors with file upload on write page.

  • Resolved DParrott

    (@dparrott)


    Hi all,

    I’m running Apache 2.2.3, PHP 5.2.0 and MySQL 5.0.27 on windows to locally test a new site.

    I’m attempting to use the file upload form on the write page to add images for use in a post but I get database errors when I attempt to upload, the errors are included below.

    WordPress database error: [Field ‘post_content_filtered’ doesn’t have a default value]
    INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, 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’, ‘2006-11-19 14:57:33’, ‘2006-11-19 14:57:33’, ”, ‘serverinfofilled6.png’, ”, ‘attachment’, ‘open’, ‘open’, ”, ‘serverinfofilled6png’, ”, ”, ‘2006-11-19 14:57:33’, ‘2006-11-19 14:57:33’, ‘4’, ‘0’, ‘image/png’, ‘http://localhost/wordpress/wp-content/uploads/2006/11/serverinfofilled6.png’)

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 3]
    SELECT category_id FROM wp_post2cat WHERE post_id =

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 1)’ at line 2]
    INSERT INTO wp_post2cat (post_id, category_id) VALUES (, 1)

    Warning: Cannot modify header information – headers already sent by (output started at C:\Documents and Settings\David\My Documents\Websites\wordpress\wp-includes\wp-db.php:104) in C:\Documents and Settings\David\My Documents\Websites\wordpress\wp-includes\pluggable-functions.php on line 269

    Any help appreciated

Viewing 5 replies - 1 through 5 (of 5 total)
  • You and this person seem to have the same problem, try doing what I had posted here once.
    http://wordpress.org/support/topic/94976?replies=2#post-476965

    Thread Starter DParrott

    (@dparrott)

    Thanks for the advice. I did search before posting the thread the first time, reviewing the search results again, in the first 30 results there’s 3 threads with this same problem, none of which have an answer.

    One had no responses, one has the response you gave and the 3rd has a response from the guy that posted it saying he got round it by setting the default value on the field to NULL.

    While that’s a workaround I’d like to know what’s causing it in the first place and if there’s a fix, one common theme seems to be when apache/mysql etc. is running on windows.

    Does the table field get a default value when running on linux? (I don’t have a way to test this at the minute). If not why does this not occur when running on linux? What changes?

    I’m back, after I submitted this thread to the wp-hackers email list, Owen Gray had shared a detailed explanation of what’s going on, and even provided a thread which contains “fixes” for this problem.

    Many thanks to Owen Gray.. πŸ˜‰ =)

    spencerp

    Thread Starter DParrott

    (@dparrott)

    Thanks for the help. πŸ™‚

    Interesting to see it’s because MySQL 5 is “too new” for WordPress. I’ll take a look at the thread with some of the fixes in it and see if I can fix it locally.

    Thanks also to Owen Gray.

    Update: I changed the wp_posts table removing the “not null” on the 3 fields listed in the other post (pinged, to_ping, and post_content_filtered) and it has solved the problem, uploading images now works.

    Awesome!! Glad to hear it worked!! Can you mark this [Resolved] now please? =) πŸ˜‰ I’ll bookmark this thread for future reference purposes then, it will be useful for in the future, when someone else has the same problems.. πŸ˜‰

    spencerp

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Errors with file upload on write page.’ is closed to new replies.