Check to see if the prep_statement is true.
This commit is contained in:
parent
f14500a40a
commit
d0d7424447
|
|
@ -95,7 +95,7 @@ else {
|
|||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
$row = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] > 0) {
|
||||
$num_rows = $row['num_rows'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@
|
|||
}
|
||||
$sql .= "limit $this->rows_per_page offset $this->offset ";
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$rows = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$this->count = count($rows);
|
||||
|
|
@ -129,6 +130,7 @@
|
|||
unset($rows);
|
||||
}
|
||||
unset ($prep_statement, $sql);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue