Page 1 of 1

fatal error message

Posted: Wed Apr 15, 2009 3:31 am
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???

Re: fatal error message

Posted: Wed Apr 15, 2009 3:35 am
by susrisha
the object $Dataset is missing a construction.. Its not initialized to any class or anything..

Re: fatal error message

Posted: Wed Apr 15, 2009 3:38 am
by gwolff2005
Hi susrisha, thanks. What do I need to write in order to initiate it. I want to draw a graph with pchart.

Re: fatal error message

Posted: Mon Apr 20, 2009 5:29 am
by gwolff2005
That was reall helpful! Thanks now it works!