Tom Hayakawa
tom_g3x****@users*****
2007年 3月 13日 (火) 01:41:15 JST
Index: xoops2jp/html/modules/legacy/kernel/handler.php diff -u xoops2jp/html/modules/legacy/kernel/handler.php:1.1.2.4 xoops2jp/html/modules/legacy/kernel/handler.php:1.1.2.4.2.1 --- xoops2jp/html/modules/legacy/kernel/handler.php:1.1.2.4 Fri Dec 8 01:17:56 2006 +++ xoops2jp/html/modules/legacy/kernel/handler.php Tue Mar 13 01:41:15 2007 @@ -1,7 +1,7 @@ <?php /** * @package Legacy - * @version $Id: handler.php,v 1.1.2.4 2006/12/07 16:17:56 tom_g3x Exp $ + * @version $Id: handler.php,v 1.1.2.4.2.1 2007/03/12 16:41:15 tom_g3x Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -68,8 +68,8 @@ { $ret = array(); - $sql = "SELECT * FROM " . $this->mTable; - + $sql = "SELECT * FROM `" . $this->mTable . '`'; + if($criteria !== null && is_a($criteria, 'CriteriaElement')) { $where = $this->_makeCriteria4sql($criteria); @@ -79,7 +79,7 @@ $sorts = array(); foreach ($criteria->getSorts() as $sort) { - $sorts[] = $sort['sort'] . ' ' . $sort['order']; + $sorts[] = '`' . $sort['sort'] . '` ' . $sort['order']; } if ($criteria->getSort() != '') { $sql .= " ORDER BY " . implode(',', $sorts); @@ -131,7 +131,7 @@ { $ret = array(); - $sql="SELECT COUNT(*) c FROM " . $this->mTable; + $sql="SELECT COUNT(*) c FROM '" . $this->mTable . '`'; if($criteria !== null && is_a($criteria, 'CriteriaElement')) { $where = $this->_makeCriteria4sql($criteria); @@ -336,7 +336,7 @@ // criteria even if this approach is few slow. // $criteria =& new Criteria($this->mPrimary, $obj->get($this->mPrimary)); - $sql = "DELETE FROM " . $this->mTable . " WHERE " . $this->_makeCriteriaElement4sql($criteria, $obj); + $sql = "DELETE FROM `" . $this->mTable . "` WHERE " . $this->_makeCriteriaElement4sql($criteria, $obj); return $force ? $this->db->queryF($sql) : $this->db->query($sql); }