我正在使用 codeigniter 并且正在执行此查询
SELECT c.id AS id, c.name AS name, c.img_add AS img, c.downloads as down, c.tag as tag, c.date as date,c.views as view FROM core c WHERE c.name = 'Ganesha (2)' ORDER BY c.downloads DESC
该查询在模型中使用,并且不返回任何数据,而在 Heidi SQL 中执行相同的查询时,会返回适当的数据。
我不知道天气是查询问题、codeigniter 问题还是 php 问题,所以我为所有人发帖。
这是我在我的 codeigniter 模型中编写的代码。这可能有助于回答。
public function getFolderDetail($folder) {
$sql = "SELECT c.id AS `id`, c.name AS `name`, c.img_add AS `img`, c.downloads as `down`, c.tag as `tag`, c.date as `date`,c.views as `view` FROM core c
WHERE c.name = ?
ORDER BY c.downloads DESC";
$params = array($folder);
return $query = $this->db->query($sql,$params);
}