versatilewt Posted April 9, 2006 Share Posted April 9, 2006 php version: 4.3.10adodb version: 4.8I'm using ADODB to connect to my mySQL database. the query is [code]$query="SELECT * FROM zipData WHERE zipcode='$_z'"; $result = $db->GetAll($query); // Execute queries $count = count($result); // Count * rows [/code] whenever it is like[code]function functionname(){$query="SELECT * FROM zipData WHERE zipcode='$_z'"; $result = $db->GetAll($query); // Execute queries $count = count($result); // Count * rows }[/code]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 [code]$result = $db->GetAll($query); // Execute queries[/code]Any ideas? Quote Link to comment Share on other sites More sharing options...
versatilewt Posted April 9, 2006 Author Share Posted April 9, 2006 removed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.