Hey Everyone!!
I am a super noob at php. Also, I am having a bit of a problem with a small project I am working on. The project is simple: use a sql db to list all of the inventory and then test whether or not each machine from the inventory is up (i.e. ping-able). I have only implemented accessing the database but I cannot get php to print the results to a HTML table.
Here is what I have so far.... :
Any suggestions?
I am a super noob at php. Also, I am having a bit of a problem with a small project I am working on. The project is simple: use a sql db to list all of the inventory and then test whether or not each machine from the inventory is up (i.e. ping-able). I have only implemented accessing the database but I cannot get php to print the results to a HTML table.
Here is what I have so far.... :
Code:
$con = mysql_connect("localhost", "root", "mysqlr0x");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$query = "SELECT id, name FROM inventory ORDER by basenet_id";
$results = mysql_query($query, $con);
while ($row = mysql_fetch_results($results)) {
echo "<tr>";
echo "<td>" .$row['name']."</td>";
echo "<td>"
echo "</table>";
}
mysql_close($con);
Comment