Error Messages In Wordpress - MySQL

Discussion in 'Programming' started by bschneider5, Jul 4, 2007.

  1. #1
    When pulling up a single post, using my post.php file I get this error when loading. Here is what it says.

    
    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 'ORDER BY post_date ASC LIMIT 1' at line 1]
    SELECT ID,post_title FROM wp_posts WHERE post_date > '' AND post_date < '2007-07-04 15:33:13' AND post_status = 'publish' AND ID != ORDER BY post_date ASC LIMIT 1
    HTML:
    Here is the actual code in the file. Any help with this would be appreciated!

    <?php get_header(); ?> 
     <div id="content_main">  
       <div class="pathway"> 
        <div class="alignleft">
        <?php previous_post_link('&laquo; %link') ?>
        </div>
        <div class="alignright"> <?php next_post_link('%link &raquo;') ?>
        </div> 
       </div>  
       <table border="0" cellpadding="0" cellspacing="0" width="519">   
        <tbody> 
         <tr>
          <td>  
           <table class="blog" cellpadding="0" cellspacing="0"> <tbody><tr><td valign="top">  
            <div>   
             <table class="contentpaneopen"> 
              <tbody>  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>  
               <tr> 
                <td class="contentheading" width="100%"> [ # ] <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>    
                </td>
               </tr>  
               <tr>
                <td> <span class="small"><?php the_time('F jS, Y') ?> under <?php the_category(', ') ?></span>
                </td>
               </tr>  
               <tr> 
                <td> 
                 <div style="width:500px; position:relative; overflow:auto;"> <p>  <?php the_content('Read more &raquo;'); ?></p>  
                  <hr size="1" color="#666666"> 
                   <div id="notable"><?php if (function_exists('wp_notable')) wp_notable(); ?>
                   </div> 
                 </div> 
                </td> 
               </tr>   
               <tr> 
                <td> <?php comments_template(); 
    // Get wp-comments.php template ?> 
                </td> 
               </tr>   <?php endwhile; ?>   <?php else : ?> 
                <tr> 
                 <td> <h2>Not found!</h2> <p>Could not find the requested page. Use the navigation menu to find your target, or use the search box below:</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> 
                 </td>
                </tr>  <?php endif; ?>  
               </tbody>
              </table> 
             </div> 
            </td>
           </tr>
          </tbody>
         </table> 
        </td>
       </tr>
      </tbody>
     </table> 
    </div> <!-- end main body --> </div></div>
      <?php get_sidebar(); ?>  <?php get_footer(); ?>
    HTML:

     
    bschneider5, Jul 4, 2007 IP
  2. ProgrammersTalk

    ProgrammersTalk Peon

    Messages:
    684
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try ID is not bla bla bla...
     
    ProgrammersTalk, Jul 4, 2007 IP
  3. bschneider5

    bschneider5 Active Member

    Messages:
    1,009
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    88
    #3
    I don't see the ID anywhere, except for the DIV's?????
     
    bschneider5, Jul 5, 2007 IP
  4. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Do you still have this problem? Are you sure that is the code file?
     
    MMJ, Jul 7, 2007 IP