What I actually called here is a zend database access method, using the fetchAll method, but since there is no such record in the database, the returned object is null, so I judge whether the object is null:
Copy code The code is as follows:
if($obj==null){
...
}
The result of writing like this is to generate the above notice, which is really strange. The object is null and cannot be accessed?
After checking the information, I found that to determine whether it is null, you need to judge like this:
Copy the code The code is as follows:
if (isset($obj)) {
echo "This var is set set so I will print.";
}
What does this isset do?
isset function is to detect whether the variable is set.
Format: bool isset ( mixed var [, mixed var [, ...]] )
Return value:
If the variable does not exist, it returns FALSE
If the variable exists and its value is NULL, it also returns FALSE
If the variable exists and If the value is not NULL, TRUE will be returned.
When checking multiple variables at the same time, TRUE will be returned only when each single item meets the previous requirement, otherwise the result will be FALSE
If a variable has been released using unset(), it will no longer It's isset(). If you use isset() to test a variable that is set to NULL, it will return FALSE. Also note that a NULL byte ("
The above introduces the PHP solution to system.getproperty Notice: Trying to get property of non-object problem, including the content of system.getproperty. I hope it will be helpful to friends who are interested in PHP tutorials.