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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.