PHP Warning:preg_match () expects parameter 2 to is string, object given in C:\inetpub\wwwroot\hp\4.php on line 80
if (! $this, Result | |!eregi ("^resource", $this and result) { return $this->output ("No data, Please execute SQL's ' SELECT ' statement first! ");
if (! $this, Result | |!preg_match ("/^resource/i", $this and result) { return $this->output ("No data, Please execute SQL's ' SELECT ' statement first! ");
Since PHP upgraded from 5.2 to 5.6, the original MySQL statement was changed to MYSQLI statement, the result can not read the data. According to Baidu hint changed the statement unfortunately still can not use error, now how to solve????
Reply to discussion (solution)
$this->result A resource, right?
Determine if the Is_resource function is applied to a resource
if (! $this->result | |! Is_resource ($this->result))
$this->result A resource, right?
Determine if the Is_resource function is applied to a resource
if (! $this->result | |! Is_resource ($this->result))
$this, result = @mysqli_query ($this, conn, $this-SQL);
That's the way it is.
Reply #1, I changed your is_resource function to solve the error problem, but still can not read the database
You var_dump $this->result to see what it is.
Reply #4 var_dump ($this, result) so? Where to add