Good day all,
Here is my code for view data within my SQL database:
<html>
<title></title>
<head></head>
<body>
<?php
mysql_connect("localhost", "Username", "Password") or
die("Could not connect: " . mysql_error());
mysql_select_db("MySQL_Name");
$sql = mysql_query("SELECT * FROM Tablename");
while($row = mysql_fetch_array($sql)) {
$name = stripslashes($row['name']);
$link = stripslashes($row['link']);
$room = $row['room'];
echo" <table width=\"100%\" cellpadding=\"3\" cellspacing=\"1\" border=\"1\">"
. "<tr> "
. " <th>Computer</th>"
. " <th>Computer Name</th>"
. " <th>Room #</th>"
. " </tr>"
. " <tr>"
." <td align=\"center\">$name</td>"
. " <td align=\"center\">$link</td>"
. " <td align=\"center\">$room</td>"
. "</tr>"
. "</table>";
}
?>
</body>
</html>
Output show up like ( in a table of course):
Computer Computer Name Room #
1 http://ComputerName:5800 1
How do i make it so that the Computer Name shows up as a clickable link?
Also how do i make it so the:
Computer Computer Name Room #
does repeat itself with more data:
Computer Computer Name Room #
3 http://CompName:5800 3
Computer Computer Name Room #
1 http://ComputerName:5800 1