TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   num rows (http://www.talkphp.com/general/5798-num-rows.html)

Keinstah 02-26-2011 06:38 AM

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.

Keinstah 03-13-2011 09:12 AM

cool 2.5k+ views with no reply :D
anyway i Solved it already


All times are GMT. The time now is 09:22 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0