WordPress databass error after upgrading to v2.0
-
Hi there, please check out https://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.
Thanks,
Mez
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(); ?>
<body id="home">
<div id="background">
<div id="page">
<?php include "logo.php"; ?>
<div id="splash">
</div>
<div id="content">
<div id="welcome">
<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="https://www.mezhopking.com/">www.mezhopking.com</a>.
</div>
<div id="photo">
<h1>My Photos from Flickr and Beyond</h1>
<div id="flickr">
<script type="text/javascript" src="https://www.flickr.com/badge_code.gne?nsid=30946784@N00&count=3&display=latest&name=0&size=square&raw=1"></script>
<a href="https://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="https://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>
</div>
</div>
<div id="post">
<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></div>
<div id="links">
<div class="navcontainer">
<script type="text/javascript" src="https://del.icio.us/feeds/js/hopkingdesign?title=del.icio.us » Look what i found"></script>
</div>
</div>
<div id="shop">
<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...</div>
</div>
</div>
<?php include "footer.php"; ?>
- The topic ‘WordPress databass error after upgrading to v2.0’ is closed to new replies.