02-26-2011, 06:38 AM
|
#1 (permalink)
|
|
The Visitor
Join Date: Feb 2011
Posts: 2
Thanks: 0
|
num rows
hello im new here and im getting this error
Fatal error: Call to a member function execute() on a non-object in PATH......
im using this class to get the num rows please correct me
PHP Code:
public function prepareDB($query = NULL) { $prepare = $this->mysqli->prepare($query); return $prepare; } public function numDB($query = NULL) { $this->stmt = $this->prepareDB($query); $this->stmt->execute(); $this->stmt->store_result(); $num = $this->stmt->num_rows; $this->stmt->close(); return $num; }
PHP Code:
$query = "SELECT * WHERE smthng='value'"; $num = $Database->numDB($query);
echo $num;
thx.
|
|
|
|