Calling ADODB inside a function?
- by David
Hi,
I'm wondering why when i put an sql ADODB query in side a function it produces the following error:
Fatal error: Call to a member function Execute() on a non-object in -path to script-
My function is something like:
$dsn = 'mysql://user:pass@localhost/db';
$db = ADONewConnection($dsn);
function getem($q){
$r=$db->Execute($q);
return…