PHP example - How to check in PHP if a variable is a database result?
PHP - How to check in PHP if a variable is a database result?
The special PHP function is_resource helps to do this.
So to check if a variable is a database result you may do the following:
<?php
if(is_resource($myVar))
{
...
}
?>