gwolff2005 Posted April 15, 2009 Share Posted April 15, 2009 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??? Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 15, 2009 Share Posted April 15, 2009 Well $DataSet is an object of some class, that we don't know. Has it been instantiated using new? The error is telling you that at that point $DataSet isn't an object. Quote Link to comment Share on other sites More sharing options...
gwolff2005 Posted April 15, 2009 Author Share Posted April 15, 2009 Ok, what I try to do is to use pchart to draw a graph... I am lost Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 15, 2009 Share Posted April 15, 2009 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. Quote Link to comment Share on other sites More sharing options...
gwolff2005 Posted April 15, 2009 Author Share Posted April 15, 2009 Hi gizmo, thanks for your help. I tried now if the testcharts of pchart are working but that looked then pretty disturbing... I am looking now for a simple but good chartprogram which I can possibly use under dreamweaver... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.