简体   繁体   English

TYPO3 MySQL选择查询,可在phpMyAdmin中使用,但不适用于TYPO3

[英]TYPO3 MySQL select query, works in phpMyAdmin but not in TYPO3

If I run the code below in phpMyAdmin for my DB, then I get 17 records, but when I run it in TYPO3 6.1.4 I get all records in DB (200), why does it not work 100% in TYPO3, when it works in phpMyAdmin. 如果我在数据库的phpMyAdmin中运行下面的代码,则得到17条记录,但是当我在TYPO3 6.1.4中运行它时,我得到了DB(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();

    }

And why all the inverted commas!?!? 以及为什么所有的引号都是逗号!?!?

$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;
";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM