Browser error: PHPWarning: preg_match () expects. PHP Warning: preg_match () expects parameter 2 to be string, object given in C: \ inetpub \ wwwroot \ hp \ 4.php on line 80
If (! $ This-> result |! Eregi ("^ Resource", $ this-> result) {return $ this-> output ("no data, please first execute the 'select' statement of SQL! ");}
If (! $ This-> result |! Preg_match ("/^ Resource/I", $ this-> result) {return $ this-> output ("no data, please execute the 'select' statement of SQL first! ");}
Since PHP has been upgraded from less than 5.2 to 5.6, all the mysql statements used have been changed to mysqli statements, and data cannot be read. I changed the statement as prompted by Baidu. Unfortunately, I still cannot use the error. how can I solve this problem now ????
Reply to discussion (solution)
$ This-> result is a resource, right?
Determine whether it is a resource application is_resource function
If (! $ This-> result |! Is_resource ($ this-> result ))
$ This-> result is a resource, right?
Determine whether it is a resource application is_resource function
If (! $ This-> result |! Is_resource ($ this-> result ))
$this -> result = @mysqli_query($this -> conn,$this -> sql);
This is the case.
Reply #1. I changed your is_resource function to solve the error. Unfortunately, I still cannot read the database.
Let's take a look at $ this-> result var_dump to see what it is.
Reply #4 var_dump ($ this-> result? Where to add