我有以下法典:
$clicks = $statement->prepare($query);
$offers->bindValue(1, $id, PDO::PARAM_INT);
$clicks->execute();
$results = $clicks->fetchAll();
- The Query works fine
- The binding works fine
What actually makes me wonder, why I have to first execute() the query to can call fetchAll(). I ve come to this solution/assumption since, execute() only returns true/false and without calling execute(), fetchAll() will not return anything. Is this the normal way of doing that?
我早就在很久以前就与裁军部合作,因此我可以非常记住如何妥善处理该问题。
非常感谢
(如果使用PHP5.3,上述代码为PDO/PDOStatement)