WordPress.org

Ready to get started?Download WordPress

Forums

blogroll database error, anyone know how to fix it? (11 posts)

  1. dwhswebhosting
    Member
    Posted 7 years ago #

    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

    http://www.alop.org/animal-rights/

    Everything else works great!

    I have two other blogs but this is the first new version so i think it's connected to that since it's the only one with an error.

  2. drmike
    Member
    Posted 7 years ago #

    I'm assuming that you're getting that in your theme. The category tags have been changed. Please review this portion of the codex for assistance.

  3. darko156
    Member
    Posted 7 years ago #

    I have the same problem

    http://komunikacii.net

    still can`t find solution

    can you be more specific about the codex solution?

  4. dwhswebhosting
    Member
    Posted 7 years ago #

    I see your is working now, what did you do? I'm a amateur at this can someone explain a little about how to fix this. And yes it's a theme.

  5. Ajd777
    Member
    Posted 7 years ago #

    WordPress has changed to use wp_list_categories to display categories now. Just switch whatever function your theme uses now with ' wp_list_categories'.

  6. dwhswebhosting
    Member
    Posted 7 years ago #

    here is the html to the side bar, I would like to have pages and the blog role there, also when I remove the side bar page
    word press adds another side bar that works but needs a little tweaking, where can I edit the side bar code when the side bar template is not used?

    <div class="cats_head_txt">Categories</div>
    </div><br style="line-height:17px "/>
    <ul>
    <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
    </ul>

    SNIP
    <?php
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    foreach ($link_cats as $link_cat) {
    ?>
    <div class="cats_head">
    <div class="cats_head_txt"><?php echo $link_cat->cat_name; ?></div>
    </div><br style="line-height:17px "/>
    <ul>
    <?php get_links($link_cat->cat_id, '<li>', '</li>', '', FALSE, 'id', TRUE,
    TRUE, -1, TRUE); ?>
    </ul>
    <br/>
    <?php } ?>

    SNIP

    [lightly moderated - snipped out stuff that clearly wasn't necessary]

  7. dwhswebhosting
    Member
    Posted 7 years ago #

    "WordPress has changed to use wp_list_categories to display categories now. Just switch whatever function your theme uses now with ' wp_list_categories'."

    I understand that they changed stuff that now doesn't work in my older theme but how do I fix it is the question. But thanks for trying to help, I don't know what to do and how to do it.

  8. jafer
    Member
    Posted 7 years ago #

    I'm looking at this and I think things are mixed up between list links and list categories.

    I've upgraded and all my Categories are showing up just fine - I didn't change anything.

    But my blogroll that I used to have show using [?php get_links('1', '[li]', '[/li]
    ', '', 0, 'name', 0, 0, -1, 0); ?] is now not showing up at all, even when I tried it with: [?php wp_get_links('1', '[li]', '[/li]
    ', '', 0, 'name', 0, 0, -1, 0); ?]

    I've been looking at the codex and trying different things but my list of links that I actually had in a links list called (oddly enough) blogroll, is the only one that doesn't seem to be showing. See http://www.idiotonastick.com/talk on the sidebar.

    Any ideas?

  9. dwhswebhosting
    Member
    Posted 7 years ago #

    Anyone else by chance that can fix this code? Thanks!

    <?php
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    foreach ($link_cats as $link_cat) {
    ?>
    <div class="cats_head">
    <div class="cats_head_txt"><?php echo $link_cat->cat_name; ?></div>
    </div><br style="line-height:17px "/>

      <?php get_links($link_cat->cat_id, '
    • ', '
    • ', '
      ', FALSE, 'id', TRUE,
      TRUE, -1, TRUE); ?>
  10. Evita
    Member
    Posted 7 years ago #

    jafer, after upgrading to 2.1 your link categories have a new ID. You find them in your Dashboard under Administration/Categories.

  11. dwhswebhosting
    Member
    Posted 7 years ago #

    O.K. I got it to work from removing the directory tags and making a couple tweaks:

    <div class="sub_cats">
    <div class="cats_head">
    <div class="cats_head_txt">Pages</div></div>
    <br style="line-height:17px "/>

      <?php wp_list_pages('title_li='); ?>

    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/hr1.jpg" alt="" width="163" height="1" align="top" style="margin:14px 0px 14px 0px "/>
    <br>

    <div class="sub_cats">
    <div class="cats_head">
    <div class="cats_head_txt">Categories</div></div>
    <br style="line-height:17px "/>

      <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>

    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/hr1.jpg" alt="" width="163" height="1" align="top" style="margin:14px 0px 14px 0px "/>
    <div class="cats_head">
    <div class="cats_head_txt">Archive</div>
    </div><br style="line-height:17px "/>

      <?php get_archives('monthly','10','custom','
    • ','
    • '); ?>

    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/hr1.jpg" alt="" width="163" height="1" align="top" style="margin:14px 0px 14px 0px "/>
    <div class="cats_head">
    <div class="cats_head_txt">Links</div>
    </div>
    <div class="cats_head"><div class="cats_head_txt"></div>
    </div><br style="line-height:17px "/>

      <?php get_links($link_cat->cat_id, '
    • ', '
    • ', '
      ', FALSE, 'id', TRUE,
      TRUE, -1, TRUE); ?>
    <br/>

Topic Closed

This topic has been closed to new replies.

About this Topic