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
Need Help for this error
Moderator: General Moderators
-
gogetthealok55
- Forum Newbie
- Posts: 3
- Joined: Tue Jan 13, 2009 3:10 am
Re: Need Help for this error
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.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Need Help for this error
NB: I would strongly recommend putting protection on your code! (MySql & shell). Also REQUEST is very sloppy!
Re: Need Help for this error
You will need to post the code for your exec() function.
-
gogetthealok55
- Forum Newbie
- Posts: 3
- Joined: Tue Jan 13, 2009 3:10 am
Re: Need Help for this error
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;
}
}
function exec($sql)
{
$result = mysql_query($sql,$this->connection);
if($result)
{
return $result;
}
else
{
echo "<br>Error in Query.<br>";
exit;
}
}
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Need Help for this error
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
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