php version: 4.3.10
adodb version: 4.8
I'm using ADODB to connect to my mySQL database.
the query is
$query="SELECT * FROM zipData WHERE zipcode='$_z'";
$result = $db->GetAll($query); // Execute queries
$count = count($result); // Count * rows
whenever it is like
function functionname(){
$query="SELECT * FROM zipData WHERE zipcode='$_z'";
$result = $db->GetAll($query); // Execute queries
$count = count($result); // Count * rows
}
the query fails, but if i take it out of the function, the error doesn't occur (Fatal error: Call to a member function on a non-object). the error occurs on
$result = $db->GetAll($query); // Execute queries
Any ideas?