Forums

Error message (9 posts)

  1. abietto
    Member
    Posted 2 years ago #

    Hi,
    at the bottom of my homepage (and in every other page of the web site, actually) has appeared an error message that says:

    Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /blablabla/home/wordpress/wp-includes/wp-db.php on line 183

    Any of you knows anything about it? Where's the problem and how can I fix it? If you need to see it yourself the web site is http://www.silver.key.it. Can you help me, please? =)

  2. drmike
    Member
    Posted 2 years ago #

    Take a look at your theme's code and try to figure out what wordpress is trying to do there. It's probably something in the footer.php file.

  3. abietto
    Member
    Posted 2 years ago #

    I checked the footer.php and I did not find anything particular... It's just

    <div class="footer">
    <?php include (TEMPLATEPATH.'/bottom.php') ?>
    <div class="bottom">
    <span class="left">Powered by Wordpress</span>
    <span class="right">Template based on blablabla</span>
    <div class="clearer"><span></span></div>
    </div>
    </div>

    and the "bottom.php" file is like this:

    <div class="col3">
    <?php
    $today = current_time('mysql', 1);
    if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 10")):
    ?>
    <h2><?php _e("Recent Posts"); ?></h2>
    <ul>
    <?php
    foreach ($recentposts as $post) {
    if ($post->post_title == '')
    $post->post_title = sprintf(__('Post #%s'), $post->ID);
    echo "<li><a href='".get_permalink($post->ID)."'>";
    the_title();
    echo '</a></li>';
    }
    ?>
    </ul>
    <?php endif; ?>
    </div>
    <div class="col3center">
    <h2><?php _e('Categories'); ?></h2>
    <ul>
    <?php wp_list_cats('sort_column=name&hierarchical=0'); ?>
    </ul>
    <h2><?php _e('Archives:'); ?></h2>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    <h2><?php _e('Search:'); ?></h2>
    <form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" id="sidebarsubmit" value="Search" />
    </form>
    </div>
    <div class="col3">
    <h2><?php _e('Meta:'); ?></h2>
    <ul>
    <li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
    <li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
    <li><a href="http://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <?php wp_meta(); ?>
    </ul>
    </div>

    The only thing I noticed is this: the line

    if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 10")):

    has a ":" at the end instead of a ";". Could that be responsible? Or maybe is something else?

  4. abietto
    Member
    Posted 2 years ago #

    That line is fine, it seems. I tried many things (even changing the ":" with a ";" but that's not the right option) and I cannot find a way to solve this problem. I checked many files and plugin but I fear I'm not reaching anything. Any of you have encountered something like this before? Can you help me, please?

  5. abietto
    Member
    Posted 2 years ago #

    Er... is anyone out there? Can you help me with this problem? The message is still there and I can't find a solution...

  6. AsHDaMaster
    Member
    Posted 2 years ago #

    The plugin which causes this DB error for me it was Google XML Sitemaps.
    Test it for yourself, try to deactivate that plugin and go over the same process by which you faced the warning.
    Hope it will work for you too.

  7. Beirdo
    Member
    Posted 1 year ago #

    The plugin that caused it for me was also the Google XML Sitemap Generator. In the options for that plugin there is:
    "Enable MySQL standard mode. Use this only if you're getting MySQL errors. (Needs much more memory!)"

    When I turned that on, it stopped whining. I guess that plugin has some buglets... :)

  8. kmessinger
    Member
    Posted 1 year ago #

    The link for your site is wrong. This link http://www.abietto.net shows validation errors that might explain your problem/

  9. kmessinger
    Member
    Posted 1 year ago #


Topic Closed

This topic has been closed to new replies.

About this Topic