0

如果我在 phpMyAdmin 中为我的数据库运行下面的代码,那么我会得到 17 条记录,但是当我在 TYPO3 6.1.4 中运行它时,我会得到数据库中的所有记录(200),为什么它在 TYPO3 中不能 100% 工作,当它在 phpMyAdmin 中工作。

public function getKategorierne($catId){
        //print $catId;
        $query = $this->createQuery();
        $query->statement('SELECT * '.
                            'FROM sys_category_record_mm '.
                            'INNER JOIN sys_category ON ( uid = uid_local ) '.
                            'WHERE tablenames = "tx_origkentaurproducts_domain_model_design" '.
                            'AND sys_category_record_mm.uid_local '.
                            'IN ('.$catId.') '.
                            'ORDER BY uid_foreign');

        return $query->execute();

    }
4

1 回答 1

0

为什么所有的引号都用引号!?!?

$query = "
SELECT * 
  FROM sys_category_record_mm r
  JOIN sys_category c
    ON uid = uid_local 
 WHERE tablenames = 'tx_origkentaurproducts_domain_model_design' 
   AND r.uid_local IN ('$catId') 
 ORDER 
    BY uid_foreign;
";
于 2013-10-31T13:12:21.623 回答