• I just installed WordPress and when I try to upload a file I get the error below. The file is being uploaded to the wp-content/uploads directory, it’s just not showing in the post.

    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-05-23 00:04:11’, ‘2006-05-23 05:04:11’, ”, ‘Area-Focus-Web3.png’, ”, ‘attachment’, ‘open’, ‘open’, ”, ‘area-focus-web3png’, ”, ”, ‘2006-05-23 00:04:11’, ‘2006-05-23 05:04:11’, ‘-1148360637’, ‘0’, ‘image/png’, ‘https://www.shadal.net/classnotes/wp-content/uploads/2006/05/Area-Focus-Web3.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)

    WordPress database error: [Out of range value adjusted for column ‘post_id’ at row 1]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES (”,’_wp_attached_file’,’E:\Apache\Shadal\classnotes/wp-content/uploads/2006/05/Area-Focus-Web3.png’)

    WordPress database error: [Out of range value adjusted for column ‘post_id’ at row 1]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES (”,’_wp_attachment_metadata’,’a:4:{s:5:\”width\”;i:1080;s:6:\”height\”;i:810;s:14:\”hwstring_small\”;s:23:\”height=\’96\’ width=\’128\’\”;s:4:\”file\”;s:74:\”E:\\Apache\\Shadal\\classnotes/wp-content/uploads/2006/05/Area-Focus-Web3.png\”;}’)

Viewing 9 replies - 1 through 9 (of 9 total)
  • Very odd.
    Check that all the files did in fact upload?

    Thread Starter Shadal

    (@shadal)

    Well I just re-copied all of the files from the archive to my webroot and it didn’t seem to fix anything.
    The images are getting uploaded and thumbnails are being created, it’s just not adding them into the post for some reason. I was able to go in manually and add them but I’m looking for a quick way to throw the pics up.

    Who is your host?
    Do you have any plugins installed?

    Thread Starter Shadal

    (@shadal)

    I’m running my own apache 2.0, php 5, MySQL5.
    No wordpress plugins installed
    The server itself is a pretty fresh windows 2k3 re-install, running about 3 weeks now.

    I thought maybe there were some php errors happening so I turned errors on in php.ini but nope, nothing came up…

    Thread Starter Shadal

    (@shadal)

    Well I’ve tried deleting the SQL database and re-installing a fresh one but still get the errors.

    I went ahead anyway and installed wpStats from https://binslashbash.org/ and get an error on the stats page in the ‘bots’ section

    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 ‘group by clientOS order by oTotal desc’ at line 1]
    SELECT COUNT(cid) as oTotal, clientOS FROM wp_stats where group by clientOS order by oTotal desc

    Looks like it get’s cut off. Maybe it’s because there is no bot data, but I have a feeling that whatever is causing the upload problem is causing this. If you see the site https://www.shadal.net/classnotes you’ll see that I’m able to post and do everything else.
    Any other ideas?
    Thanks

    Thread Starter Shadal

    (@shadal)

    I’m still getting this, does anyone have any suggestions? Am I missing a module wordpress needs in apache or mysql maybe? PHP extension? Any Ideas? …Help…

    Someone correct me if I’m wrong – but I think the issue is that you’re running MySQL 5. From what I recall (again, if I’m wrong, please beat me with a wet noodle!) WordPress isn’t compatible with MySQL5 yet….so that could be a big issue right there.

    With 2.0.2 I believe WP is compatible with mysql 5. Earlier versions had “issues”…

    I’ve seen quite a few comments, however, but image uploading and using WIMP (windows/iis/mysql/php). Not sure what to suggest though.

    See? Handy beat me with the wet noodle. ?? There goes my theory! (Sorry I can’t be of more help!)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Getting SQL Errors when Uploading Files’ is closed to new replies.