WordPress.org

Support

Support » How-To and Troubleshooting » Mysql – problem with the new version

Mysql – problem with the new version

  • mjhasinus

    @mjhasinus

    Hi,
    I updated from WordPress 1.5 to the newest one today. All went smooth, but in relation to the calendar I get this error:

    [Unknown column ‘u.user_nickname’ in ‘field list’]
    SELECT p.id AS id, post_title, post_date, u.user_nickname AS author FROM wp_posts p, wp_post2cat p2c, wp_users u WHERE post_status = ‘publish’ AND post_date_gmt > ‘2006-10-01 00:00:00’ AND p.id = post_id AND p.post_author = u.id AND category_id = 13 ORDER BY post_date LIMIT 6

    Since I am a bit lost with mysql (what I guess, it is), can you see here something, what seems for you very wrong and what I could TRY to change?

    Thanks in advance for all hints!
    Markus

Viewing 8 replies - 1 through 8 (of 8 total)
  • Did you run upgrade.php?

    mjhasinus

    @mjhasinus

    Thanks for your answer, Viper007Bond.

    Yes, I did let run upgrade.php

    I checked now the whole site again, and basically I see two errors:

    1) the one above (in the sidebar to the right)
    2) the next error-message, if I am searching something (but the results are correct):

    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 1]
    SELECT COUNT(DISTINCT ID) FROM

    These are the only errors, what I can see. My site, if you want have a look, is:

    http://www.sinusbild.com/blogxx/

    Thanks really for every help!!
    Markus

    mjhasinus

    @mjhasinus

    OK, I guess, nobody knows this.
    Curious, because, I have done exactly, what the installation help sayed. And I tried wordpress with several themes, all the same.

    When I look at your site, it seems OK to me. I don’t see any errors on the calendar. I don’t get any errors when clicking on dates in the calendar. While I don’t speak or read German nearly as fluently as your English here, I can tell an error message in any language and there are none.

    mjhasinus

    @mjhasinus

    Hi billh,

    you have really surprised me this morning. I did not thought, that still a post will come. THANKS for that.

    You are right: The calendar-problem is gone. I installed the plugin a new. The calendar is now fine.
    But the main-error is still there.

    If you go to the site
    http://www.sinusbild.com/blogxx/

    and scrolls down, at the end in the main window, you will see allways this message:

    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 1]
    SELECT COUNT(DISTINCT ID) FROM

    And this message scares me a bit. It would be very nice, if you could have a look at this.

    BTW: thanks for you hidden compliment about my English, but I would wish, that I could write FLUENTLY English. I am sure, your German is not that bad, as you might think

    I wish you a nice day!
    I wuensche Dir einen schoenen Tag!

    mjhasinus

    @mjhasinus

    Does anybody maybe know a hint, what php-file could be involved for this message?

    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 1]
    SELECT COUNT(DISTINCT ID) FROM

    Because then I could try to look at the lines.
    Thanks for any help

    Markus

    Looks like a problem with one of your template tags. It seems that you are using the Jakarta theme; the error is in the “index.php” file. Try this…

    Change this line: (it is line #30 in the Jakarta theme index)
    <div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?></div>
    to this:
    <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    Then change this line: (the next line)
    <div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?></div>
    to this:
    <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>

    These changes use different template tags. You’ll also need to change the same content in the file “single.php”, “archive.php” and “search.php”.

    Select count (distinct id) FROM

    This query is incomplete. For me it started happening when I changed the main query and removed the DISTINCT and GROUP BY to increase the performance.

    I checked the template-functions-link.php. It has

    posts_nav_link function towards the end.

    An echo on $fromwhere variable returned nothing.

    Replacing this line

    preg_match(‘#FROM\s(.*)\sGROUP BY#siU’, $request, $matches);

    By this

    preg_match(‘#FROM\s(.*)\s#siU’, $request, $matches);

    fixed it.

    It was trying to get table name by parsing the initial query and since I had removed the group by from it, it could not parse it properly.

    Atul Bansal

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Mysql – problem with the new version’ is closed to new replies.