Mysql Query没有返回任何输出?

I'am using codeigniter and I'm executing this query

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

The query is used in the model, and does not returns any data, while the same query when executed in the Heidi SQL, returns me with the appropriate data.

I don't know weather it is a query problem, codeigniter problem or php's, so I'm posting for all.

This is a code which I wrote in my codeigniter model. This may help in answering.

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);
}

I got the problem, actualy the value in folder for Ganesh (2) was coming as Ganesha (2) which is a url format of the value, as I am sending this value as urls.

I did this

public function getFolderDetail($folder) {
$folder = str_replace(')',')',$folder);
$folder = str_replace('(','(',$folder);
    //echo $folder = str_replace('(','\(',$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);
}

and now the code works fine.

My suspicion may be reserved words, and may need tick marks around them. I would start with your

 `name`, `date` and `view` columns... 

the tick is the ` key left of the #1 on keyboard, not a single quote

each part that may be reserved would need the tick marks... such as

c.`name` as `name` (same with others) 

it would be applicable in the where clause to

where c.`name` = 'something'

ARE YOU running into an invalid function?

By sending in the string you mention of "Alexa (2)", might it be interpreting that as a FUNCTION called "Alexa", and it is passing a parameter of 2, and thus Alexa is not a real function. Can you try by NOT having parens as the value?

Here is a list of MySQL reserved words

try to escape reserved word "date"

SELECT `c`.`date` as `date` etc...

http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html