• hello…im new to WordPress, but have done rather well in customizing it to my liking. the only problem im having is the im getting an error message in my sidebar that im not familiar with.

    here is the error…

    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 cat_id, cat_name FROM

    …and the page it is found on…

    https://flyerflies.com/blogs/The_FlyerFly/

    …here is the code from my sidebar.php file…

    [code]
    <div class="sidebar">
    <h2><?php _e('Categories'); ?></h2>
    <ul class="menu">
    <?php wp_list_cats('sort_column=name'); ?>

    <?php wp_list_pages('sort_column=menu_order&title_li=<h2>' . __('Pages') . '</h2>' ); ?>
    <?php /* If this is a category archive */ if (is_single()) { ?>
    <h2><?php _e('Archives'); ?></h2>

      <?php wp_get_archives('type=monthly&show_post_count=0'); ?>

    <?php } ?>

    <h2><?php _e('Search'); ?></h2>

    <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
    <input type="text" name="s" id="s" size="15" />
    <input type="submit" name="submit" value="<?php _e('Search'); ?>" />
    </form>

    <?php if (is_home()) { ?>
    <?php
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    foreach ($link_cats as $link_cat) {
    ?>
    <h2><?php echo $link_cat->cat_name; ?></h2>

      <?php wp_get_links($link_cat->cat_id); ?>

    <?php } ?>
    <?php } ?>

    <h2><?php _e('Latest'); ?></h2>

      <?php wp_get_archives('type=postbypost&limit=6'); ?>

    <?php if (is_home()) { ?>
    <?php if (function_exists('wp_theme_switcher')) { ?>
    <h2>Styleswitcher</h2>
    <?php wp_theme_switcher(); ?>
    <?php } ?>

    <h2><?php _e('Meta:'); ?></h2>
    <ul class="noli">
    <?php wp_register(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter TheFlyerFly

    (@theflyerfly)

    sorry about the code not being nested properly…i wanted to edit it, but i couldnt.

    if you need me to post the code again, let me know.

    Thread Starter TheFlyerFly

    (@theflyerfly)

    something i have noticed after staring at my code blankly for quite awhile…

    the portion of the code that appears to be generating the error has to do with search bar results. once i enter something into the search field and submit it, the resulting page does not have the error on it.

    eagerly, yet patiently awaiting some friendly help. thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘database error’ is closed to new replies.