PHPGraphLib Tutorial #2: MYSQL and PHPGraphLib
In this example, we are going to show a simple example of how to use PHPGraphLib with MYSQL.
Include the source file in a new script and create the PHPGraphLib ObjectInclude the source PHPGraphLib class file at the top of your stand alone php script. This script will only include the PHP calls to create your graph. Next, create a PHPGraphLib object.
Add data from MYSQLWe are going to query our database, add that data to an array, and then pass that information to PHPGraphLib. The sales count will be used as y-axis values, and the sales group name will be used as the x -axis values. See http://www.php.net/mysql for more information on how to connect to your MYSQL server with PHP. You will need to change the system dependent variables, such as username, password, database, and table name when using this example.
Include the created script as the src of an image on the desired pageOn the page you want the graph to appear, create an HTML image tag and set the src="" to the location of the script you created above.
For other examples, view the Examples page