Jump to content

fatal error message


gwolff2005

Recommended Posts

Hi guys, I have the following code

 

<?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

{ $DataSet->AddPoint($row["resultspo"],"Serie1"); }

Does anyone of you have an idea what is wrong???

Link to comment
https://forums.phpfreaks.com/topic/154170-fatal-error-message/
Share on other sites

You should read the manual for that library then.  I'm sure it has examples.  At very least I'd expect something like:

 


$DataSet = new pchart;

 

pchart should be whatever the name of the pchart class is, and also the class definition needs to be require_once() into the script prior to instantiating the object.

Link to comment
https://forums.phpfreaks.com/topic/154170-fatal-error-message/#findComment-810454
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.