fatal error in php
<pre><code>    if(!empty($home) &amp;&amp; !empty($title) &amp;&amp; !empty($meta))
{

function updcfg($condition,$status){
$db-&gt;query("UPDATE site_config SET status = '".$status."' WHERE condition = '".$condition."' ");
}
updcfg("home",$home);
updcfg("title",$title);
updcfg("meta",$meta);
updcfg("news",$news);
}
</code></pre>

<p>the current code that you see above is not working and giving me this error :</p>

<pre><code>Fatal error: Call to a member function query() on a non-object in /home/main.php on line 20
</code></pre>

<p>I deleted the function.. and the code worked with no problems ! can anyone tell what is wrong with the code?</p>
