Hi there, please check out http://www.hopkingdesign.com.
This error only occurs on the index.php page of my site.
This page used to work perfectly before I upgraded to version 2 of WordPress. If this can't be resolved soon, I'm going to have to revert to version 1.5 again.
Below I've included the WordPress error I recieve and my index.php code.
Any help on this issue will be very very welcome.
This is the error I get:
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 'AND comment_approved = '1'' at line 1]
SELECT COUNT(comment_ID) FROM wp_comments WHERE comment_post_ID = AND comment_approved = '1';
This is my index.php code:
<?php get_header(); ?>
<?php include "logo.php"; ?>
<h1>Hello and welcome</h1>
<h2>We are Hopking Design</h2>
Hopking Design is a one man creative studio run by Mez Hopking, a freelance web designer, graphic designer and professional photographer, based in Bournemouth, England.
I specialise in building intuitively made, well laid out and logically structured XHTML and CSS standards compliant web sites. I also design for print, in particular logo design, t-shirt design and re-branding. Please head on over to my <a href="portfolio.php?page=welcome">portfolio</a> to view some examples of my work. Alternatively, to view my photography portfolio please head on over to <a href="http://www.mezhopking.com/">www.mezhopking.com</a>.
<h1>My Photos from Flickr and Beyond</h1>
<a href="http://www.flickr.com/photos/mez/"><img src="images/layout/flickr-img.png" border="0" id="flickrimg" title="See more of my Flick feed" alt="See more of my Flick feed" /></a>
<a href="http://www.mezhopking.com/"><img src="images/layout/mezhop-img.png" border="0" id="mezhopimg" title="See my photoblog at mezhopking.com" alt="See my photoblog at mezhopking.com" /></a>
<h1>Latest Journal Entry</h1>
<?php $posts = get_posts('numberposts=1&order=DESC&orderby=post_title'); foreach ($posts as $post) : start_wp(); ?>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_date(); echo ""; ?>
<?php the_excerpt(); ?>
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Continue Reading...</a></h3>
<?php endforeach; ?>
<p class="comment"><?php edit_post_link('Edit','','|'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »','','|'); ?> <?php next_posts_link('« Previous Entries','','|') ?> <?php previous_posts_link('Next Entries »' ,'','|') ?><a href="feed:<?php bloginfo('rss2_url'); ?>">RSS Feed</a>
<h1>Shop and Downloads</h1>
<h2>The real french connection</h2>
<img src="images/shop-fr-tshirts.png" alt="Real French connection T-shirts. Visit my shop for more..." title="Real French connection T-shirts. Visit my shop for more..." />
Inspired by a recent trip to Paris, I've designed these rather lovely t-shirts. Choose which French iconic image you'd like wear with pride...
<?php include "footer.php"; ?>