Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I had Typed following code and i had getting error as ,
XML
Fatal error: Call to a member function Query() on a non-object





<pre lang="php">$strQuery = &#39;SELECT * FROM `allraw_material&#39;;


  $objDbResult = $objDatabase-&gt;Query($strQuery);


  $objProjectArray = AllrawMaterial::InstantiateDbResult($objDbResult);


  foreach ($objProjectArray as $objProject) {
      _p($objProject-&gt;RawMaterial . &#39; has a budget of $&#39; . $objProject-&gt;BasicRate);
      _p(&#39;&lt;br/&gt;&#39;, false);
  }</pre>
Posted
Comments
Killzone DeathMan 12-Feb-14 8:48am    
Please update you question, its confusing and something makes no-sense because there are just a small sniped code

1 solution

It means that $objDatabase is not an instance of a class. I suspect your database initialisation code failed, or maybe you forget to add it in since there isn't any in your question.
 
Share this answer
 
Comments
Killzone DeathMan 13-Feb-14 4:37am    
Thats the point "since there isn't any in your question"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900