I'm using jpgraph to generate GPA chart. the x-axis is for the GPA value, while the y-axis is for the year/semester.

my problem is : i fetch the value for both x-axis and y-axis element from the database. i pack all elements in an array variable using array_unshift(). everything is okay but it came error like this

Empty input data array specified for plot. Must have at least one data point.

Here's my code


$query="SELECT * FROM sksips WHERE sksips.id_student='$id' GROUP BY semester";

//fetch the data from dB
//store data (sksips.id_semester) into array $smtThn
// trial code
//store IP data into array $ip
//	array_unshift($ip,3.25,3.44,3.0,3.9,3.8);

when i run the trial code, it works fine. but, when i fetch from the database it doesn't work. Any idea?? thanks :)

oh my God!! JPGraph is innocent. the suspect was the parameter :p. the parameter (id) hadn't been passed. so the query didn't work.

Note: JPGraph is innocent in this case :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.