Page 1 of 1

Need Help for this error

Posted: Tue Jan 13, 2009 3:17 am
by gogetthealok55
Call to a member function exec() on a non-object


all i have done is this

$idno = $_REQUEST['company_idno'];
$sql = "select * from tbl_category where fld_int_compid= '$idno'";
$result = $ado->exec($sql);
$row = $ado->fetch($result);

any help releated to this will be appriciated

Re: Need Help for this error

Posted: Tue Jan 13, 2009 3:21 am
by gogetthealok55
i have created exec() function and fetch() function and created ado object...which i have used here... i have used the same process the query in other case which works pretty well but i m getting the above error here.

Re: Need Help for this error

Posted: Tue Jan 13, 2009 3:27 am
by jaoudestudios
NB: I would strongly recommend putting protection on your code! (MySql & shell). Also REQUEST is very sloppy!

Re: Need Help for this error

Posted: Tue Jan 13, 2009 9:25 am
by jthayne
You will need to post the code for your exec() function.

Re: Need Help for this error

Posted: Wed Jan 14, 2009 10:45 pm
by gogetthealok55
this is code for exec()

function exec($sql)
{
$result = mysql_query($sql,$this->connection);
if($result)
{
return $result;
}
else
{
echo "<br>Error in Query.<br>";
exit;
}
}

Re: Need Help for this error

Posted: Thu Jan 15, 2009 2:10 am
by jaoudestudios
Sorry I thought we were talking about dropping into the shell with the exec function...http://uk3.php.net/function.exec.

You should call your function something else. PHP does not have namespaces yet, you'll have to wait until php6 is released :)...
http://uk.php.net/manual/en/language.na ... ionale.php