0

i want to ask.......if i have the data in a database of mysql....how can I generate html, chart from the database(mysql)

4
Contributors
3
Replies
5
Views
8 Years
Discussion Span
Last Post by ferensick
0

I'm not sure what you mean.

Are you asking how to display sql data in a HTML table? Or would you like to display graphs and charts based on your sql data?

0

i want to ask.......if i have the data in a database of mysql....how can I generate html, chart from the database(mysql)

given the row set that you want to render,
for your html issue, you may use the repeater control or a loop of echos to your row set.
for your chart, please use a chart control, there a bulk free, and give the control the row set.

0

To Generate HTML based on your MySQL database you can use QCODO: http://www.qcodo.com/
I've used this before and it's pretty handy.
Also what is the overall objective? Are you trying to manage your DB via your web browser? Or are you trying to make a simple report? For managing PHPMyAdmin is very useful.
And to simply have a table displayed on a web page in a chart form, use PHP to get the table values, and HTML to format the table.
QCODO may be too much if you just want to display one table in HTML.
http://www.freewebmasterhelp.com/tutorials/phpmysql/4
Example:

<?
$username="username";
$password="password";
$database="your_database";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

echo "<b><center>Database Output</center></b><br><br>";

$i=0;
while ($i < $num) {

$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$phone=mysql_result($result,$i,"phone");
$mobile=mysql_result($result,$i,"mobile");
$fax=mysql_result($result,$i,"fax");
$email=mysql_result($result,$i,"email");
$web=mysql_result($result,$i,"web");

echo "<b>$first $last</b><br>Phone: $phone<br>Mobile: $mobile<br>Fax: $fax<br>E-mail: $email<br>Web: $web<br><hr><br>";

$i++;
}

?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.