What do I need to change in the following code for my links, which are now listed under Blogroll, to show up correctly?
<!-- Begin - Links from the 'Links Manager'-->
<?php
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
foreach ($link_cats as $link_cat) {
if (get_links($link_cat->cat_id, '', '', '', FALSE, '', FALSE, FALSE, -1, FALSE, FALSE)) {
?>
<div class="left-widget-title"
id="linkcat-<?php echo $link_cat->cat_id; ?>">
<?php echo $link_cat->cat_name; ?>
</div>
<div class="left-widget">
<ul>
<?php wp_get_links($link_cat->cat_id); ?>
</ul>
</div>
<?php
}
}
?>
<!-- End - Links from the 'Links Manager'-->
With the above code, I get the following 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