Hi,
I am trying to create a situation where I have:
Date 01.09 02.09 03.09 04.09
NAME Adam you -- --
PHONE 123 456
Date 01.09 02.09 -- --
NAME Paul Here -- --
PHONE 678 890
I can populate the days for the month of October (from the 1st to the 31st) going horizontal. But I cannot seem
to get the dates for a vertical population to work, that is for the fist day of October
I want to see all the values.
Here's a snippet of my code.. Any help would be appreciated:
<html>
<head>
<style type="text/css">
table.header { clear: right; border: 0px;}
table.data {float: left;}
th, td {align: left; border: 1px solid black;}
td {padding-top: 1.5px; padding-bottom: 1.5px;}
</style>
<head>
<body>
<?php
$connection = mysql_connect("localhost", "root", "stacey");
if(!$connection)
{
die('could not connect:' . mysql_error());
}
mysql_select_db("DAILY_CHECKS", $connection);
$result=mysql_query("select * from Performance_Activity_IT GROUP BY Date" );
$i=0;
$col=0;
$numcols=6;
$num=mysql_numrows($result);
for ($i=0; $i<=$num; $i++)
{
//while($i <= $num)
// {
// $i++;
echo "<table class='header' border='5' cellpadding='5' cellspacing='6' width='100%'><tr>
<td><h1>System Performance Activity</h1></td></tr></table>";
echo "<table class='data'>";
echo "<thead>";
echo "<tr><th align='left' width='40%'>DATE</th></tr>";
echo "<tr><th align='left' width='40%'>HOSTNAME</th></tr>";
echo "<tr><th align='left' width='40%'>IP</th></tr>";
echo "<tr><th align='left' width='40%'>ACTIVE_PROCESSES</th></tr>";
echo "<tr><th align='left' width='40%'>MEMORY_FREE</th></tr>";
echo "<tr><th align='left' width='40%'>MEMORY_SWAP_In</th></tr>";
echo "<tr><th align='left' width='40%'>MEMORY_SWAP_OUT</th></tr>";
echo "<tr><th align='left' width='40%'>CPU_BY_USER_APPS</th></tr>";
echo "<tr><th align='left' width='40%'>CPU_BY_OS</th></tr>";
echo "<tr><th align='left' width='40%'>CUP_IDLE_TIME</th></tr>";
echo "</thead>";
echo "</table>";
while($row = mysql_fetch_row($result))
{
for($i=0; $i<=$row; $i++)
{
echo "<table class='data'>";
echo "<tr><td>$row[0]</td></tr>";
echo "<tr><td>$row[1]</td></tr>";
echo "<tr><td>$row[2]</td></tr>";
echo "<tr><td>$row[3]</td></tr>";
echo "<tr><td>$row[4]</td></tr>";
echo "<tr><td>$row[5]</td></tr>";
echo "<tr><td>$row[6]</td></tr>";
echo "<tr><td>$row[7]</td></tr>";
echo "<tr><td>$row[8]</td></tr>";
echo "<tr><td>$row[9]</td></tr>";
echo "</table>";
break;
}
/* for($col=0; $col<=$numcols; $col++)
{
echo "<table class='data'>";
echo "<tr><td>$col[0]</td></tr>";
echo "<tr><td>$col[1]</td></tr>";
echo "<tr><td>$col[2]</td></tr>";
echo "<tr><td>$col[3]</td></tr>";
echo "<tr><td>$col[4]</td></tr>";
echo "<tr><td>$col[5]</td></tr>";
echo "<tr><td>$col[6]</td></tr>";
echo "<tr><td>$col[7]</td></tr>";
echo "<tr><td>$col[8]</td></tr>";
echo "<tr><td>$col[9]</td></tr>";
echo "</table>";
break;
} */
}
mysql_free_result($result);
}
?>
</body>
</html>