php - Parameter expected warning -


i have following warning when run code:

call_user_func() expects parameter 1 valid callback, function 'db_connect' not found or invalid function name

the code:

 require_once("mo_object.php");   class mo_model extends mo_object  {     private $con;       static function db_query($qry)     {        $this->db_connect;         return $qry;     }      function db_connect()     {        $con =  mysqli_connect($rconf['host'],$mo_conf['usr'],$mo_conf['password'],$mo_conf['da   tabase']);     }  } 

why can't run db_connect function correctly?

thanks.

if class , these functions both in same class, try this:

static function db_query($qry) {    $this->db_connect();    return $qry; }  public function db_connect() {    $con = mysqli_connect($rconf['host'],$mo_conf['usr'],$mo_conf['password'],$mo_conf['database']); }  

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -