[pLog-svn] r637 - plog/trunk/class/dao

subaochen at devel.plogworld.net subaochen at devel.plogworld.net
Fri Dec 31 13:20:13 GMT 2004


Author: subaochen
Date: 2004-12-31 13:20:12 +0000 (Fri, 31 Dec 2004)
New Revision: 637

Modified:
   plog/trunk/class/dao/articles.class.php
Log:
fix sql error while comparing date


Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php	2004-12-31 02:05:23 UTC (rev 636)
+++ plog/trunk/class/dao/articles.class.php	2004-12-31 13:20:12 UTC (rev 637)
@@ -181,7 +181,7 @@
 
             // gets the article that is just next in time
             $query = "SELECT * FROM ".$this->getPrefix()."articles 
-			                  WHERE date > ".$article->getDate()." AND 
+			                  WHERE date > '".$article->getDate()."' AND 
 							        status = 1 AND blog_id = '".Db::qstr($blogId)."' ORDER BY date ASC LIMIT 1;";
             $result = $this->Execute( $query );
             if( !$result )
@@ -211,7 +211,7 @@
 
             // gets the article that is just next in time
             $query = "SELECT * FROM ".$this->getPrefix()."articles 
-			                   WHERE date < ".$article->getDate()." AND status = 1 AND 
+			                   WHERE date < '".$article->getDate()."' AND status = 1 AND 
 							         blog_id = '".Db::qstr($blogId)."' ORDER BY date DESC LIMIT 1;";
             $result = $this->Execute( $query );
             if( !$result )




More information about the pLog-svn mailing list