Jump to content

Recommended Posts

Hello,

 

I was wondering if I could create a graph of some sort out of a PHP table, this is my current code:

 

<?php



$sql1 = mysql_query("SELECT * FROM `user_history` WHERE `userid` = '$user1'") or die("Transaction Error");



$sql1_rows = mysql_num_rows($sql1);







if($sql1_rows == "0") {



echo 'Your Usage Will Start Counting Once Your First Billing Period Has Passed.';



} else {



echo '<table border="0" align="center" width="60%">



<tr>



    <th>Billing Period Ending</th>



    <th>Plan Data Used (MB)</th>



    <th>Off Peak Used (MB)</th>



    <th>Uploads (MB)</th>





</tr>';



while($user_history = mysql_fetch_array($sql1)) {



echo '<tr>



    <td align="center">'.$user_history['billingend'].'</th>



    <td align="center">'.$user_history['used'].'</th>



    <td align="center">'.$user_history['offused'].'</th>



    <td align="center">'.$user_history['uploads'].'</th>





</tr>';



}



echo '</table>';



}



?>

 

I was wondering if someone had a script that looked like this:

 

usageimagett4.png

 

Any would be fine thanks:)

Link to comment
https://forums.phpfreaks.com/topic/122069-solved-creating-a-graph-out-of-a-table/
Share on other sites

you are doing that part already what you don't know is how to build the image and like I said look at GD

 

Start laying out a static graph image and then add in the data once u get the ideas behind GD

 

Barand has written some tutoirals on it that are useful

http://members.aol.com/barryaandrew/baagrid/baagridguide.html

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.