MySQL Forums
Forum List  »  Quality Assurance

mysql(wamp) link to html
Posted by: jake eum
Date: November 10, 2012 11:22PM

Hello people

im trying to link mysql(wamp) server to html
(just try to show the mysql database table to html)

=====================================================
<html><body>

<?php
mysql_connect("localhost","root","")
$db = mysql_select_db("test",$db);
mysql_select_db("guest_tb",$db);
$result = mysql_query("select uid,name,email from guest_tb",$db);
if($myrow = mysql_fetch_array($result)){
echo "<table border=1>\n";
echo "<tr><th>UID</th><th>NAME<th/><th>E_Mail</th></tr>\n";

do{
printf("<tr><td>%d</td><td>%s</td><td>%s</td></tr>\n",
$myrow["uid"],$myrow["name"],$myrow["email"]);
}while($myrow=mysql_fetch_array($result));

echo"</table>\n";
} else{


echo "Sorry , No records were found!!!!!";

}
?>
</body></html>

==============================================================
this is my code and output is

==============================================================
\n"; echo "UIDNAMEE_Mail\n"; do{ printf("%d%s%s\n", $myrow["uid"],$myrow["name"],$myrow["email"]); }while($myrow=mysql_fetch_array($result)); echo"\n"; } else{ echo "Sorry , No records were found!!!!!"; } ?>
==============================================================
help

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql(wamp) link to html
1789
November 10, 2012 11:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.