$result_a = $db->prepare("SELECT ... WHERE `static_id`= :statistic_page ... ;");
foreach ($result as $row) {
$result_a->bindParam(':statistic_page', $row['statistic_page'], PDO::PARAM_INT);
$result_a->execute();
$result_a = $result_a->fetch();
Fatal error: Call to a member function bindParam() on a non-object in C:\Program Files\Zend\Apache2\htdocs\gcms\module\backend\statistic\admin.statistic.php on line 62
If I change it to:
foreach ($result as $row) {
$result_a = $db->prepare("SELECT ... WHERE `static_id`= :statistic_page ... ;");
$result_a->bindParam(':statistic_page', $row['statistic_page'], PDO::PARAM_INT);
$result_a->execute();
$result_a = $result_a->fetch();
But then I don't see no use of using prepare and others statements.
What would be the correct solution to solve this task?