• Hi,

    I installed the latest wordpress and I am using the theme, freshy.

    On the sidebar I am getting this 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]

    …Under the “Links” coloum.

    PLEASE help! πŸ˜€

    http://game-warp.com <– the blog

Viewing 11 replies - 1 through 11 (of 11 total)
  • That’s a theme incompatibility.
    You have a code (shown in your other post) that refers to categories (cat_ID). There is no categories table in WP 2.3.

    Thread Starter p0werrr

    (@p0werrr)

    Hi and thanks for the reply!

    Do you have any idera how I can fix this?

    http://codex.wordpress.org/Template_Tags#Links_Manager_tags
    Check which are the working and the deprecated template tags.
    Check your sidebar.php to see what code is there. If there is an old code – replace it.

    Thread Starter p0werrr

    (@p0werrr)

    Here is my sidebar.php:

    <?php global $freshy_options; ?>
    
    	<div id="sidebar">
    		<div>
    		<?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    		<?php if(function_exists('yy_menu')) : ?>
    			<h2><?php _e('Navigation',TEMPLATE_DOMAIN); ?></h2>
    			<ul>
    			<?php yy_menu('sort_column=menu_order&title_li=',
    								'hide_empty=0&sort_column=name&optioncount=1&title_li=&hierarchical=1&feed=RSS&feed_image='.get_bloginfo('stylesheet_directory').'/images/icons/feed-icon-10x10.gif'); ?>
    			</ul>
    
    		<?php elseif (function_exists('freshy_menu')) :
    			freshy_menu($freshy_options['args_pages'],$freshy_options['args_cats']);
    		endif; ?>
    
    			<h2><?php _e('Search',TEMPLATE_DOMAIN); ?></h2>
    			<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    
    			<h2><?php _e('Links',TEMPLATE_DOMAIN); ?></h2>
    			<ul>
    			 <?php
    			 $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    			 foreach ($link_cats as $link_cat) {
    			 ?>
    			  <li id="linkcat-<?php echo $link_cat->cat_id; ?>"><?php echo $link_cat->cat_name; ?>
    			   <ul>
    			    <?php wp_get_links($link_cat->cat_id); ?>
    			   </ul>
    			  </li>
    			 <?php } ?>
    			</ul>
    		<?php endif; ?>
    		</div>
    	</div>

    Is there any chance you can change the tags/help me? I’m pretty new to this πŸ™

    Thanks πŸ˜€

    I’d replace this:

    <h2><?php _e('Links',TEMPLATE_DOMAIN); ?></h2>
    			<ul>
    			 <?php
    			 $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    			 foreach ($link_cats as $link_cat) {
    			 ?>
    			  <li id="linkcat-<?php echo $link_cat->cat_id; ?>"><?php echo $link_cat->cat_name; ?>
    			   <ul>
    			    <?php wp_get_links($link_cat->cat_id); ?>
    			   </ul>
    			  </li>
    			 <?php } ?>
    			</ul>

    with whatever is suggested in the Codex for your version.

    Thread Starter p0werrr

    (@p0werrr)

    How do I know what is suggested in the codex for my version?

    I am running the latest wordpress, I just installed it yesterday @ http://game-warp.com

    Thanks.

    Thread Starter p0werrr

    (@p0werrr)

    You said:

    There is no categories table in WP 2.3.

    So there’s no way I can get it to work? πŸ™

    Not with that code I posted above. Delete it from your sidebar.
    Then go and pick one of the Link template tags from the Codex, that is NOT deprecated and put it in your sidebar file. Use them in their simplest form to start.

    Thread Starter p0werrr

    (@p0werrr)

    So I can use this:

    http://codex.wordpress.org/Template_Tags/get_links_list

    ?

    I’m sligtly confused, sorry πŸ™

    IF it’s quick is there any chance you can do it for me please? πŸ˜€

    If so just code tag the whole of the sidebar.php

    Thanks πŸ˜€

    Try it. Only you can test if it works.
    Delete what I said and replace it with
    <?php get_links_list('id'); ?>
    See if it works. If not, try another tag – bookmark_list is the latest…

    Thread Starter p0werrr

    (@p0werrr)

    YES!

    Thank you ever so much!

    It works!

    Whoooooooooooooo

    THANKS AGAIN!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Error!’ is closed to new replies.