fatal error message

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gwolff2005
Forum Commoner
Posts: 68
Joined: Sun Apr 05, 2009 10:58 am

fatal error message

Post by gwolff2005 »

Hi guys, I have the following code

Code: Select all

<?php $db = mysql_connect("localhost", "username", "password");   
if ( $db == "" ) { echo " DB Connection error...\r\n"; exit(); }   
  
mysql_select_db("guntmar",$db);  $Requete = "SELECT resultspo, resultsmo, resultspassion FROM `users`";   
$result  = mysql_query($Requete,$db);   
while ($row = mysql_fetch_array($result))   
 { $DataSet->AddPoint($row["resultspo"],"Serie1"); }
 { $DataSet->AddPoint($row["resultsmo"],"Serie2"); } 
 { $DataSet->AddPoint($row["resultspassion"],"Serie3"); } 
 $DataSet->AddAllSeries(); 
 $DataSet->SetSerieName("Passion Orientation","Serie1"); 
 $DataSet->SetSerieName("Motivation","Serie2"); 
 $DataSet->SetSerieName("Passion","Serie3"); 
  ?>
When I run the script I get the error message
Fatal error: Call to a member function on a non-object in /home/guntmar/public_html/intro.php on which is the line with the code

Code: Select all

{ $DataSet->AddPoint($row["resultspo"],"Serie1"); }
Does anyone of you have an idea what is wrong???
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: fatal error message

Post by susrisha »

the object $Dataset is missing a construction.. Its not initialized to any class or anything..
gwolff2005
Forum Commoner
Posts: 68
Joined: Sun Apr 05, 2009 10:58 am

Re: fatal error message

Post by gwolff2005 »

Hi susrisha, thanks. What do I need to write in order to initiate it. I want to draw a graph with pchart.
gwolff2005
Forum Commoner
Posts: 68
Joined: Sun Apr 05, 2009 10:58 am

Re: fatal error message

Post by gwolff2005 »

That was reall helpful! Thanks now it works!
Post Reply