[56K WARN] Unique Display MYSQL Data
Posted: Sat Aug 20, 2005 4:34 pm
Background: ok so i would like to collect data from students of their information and also their class scheldules.
Problem: I managed to display everything perfectly. The only problem is displaying the scheldules in a decent viewable way. If anyone knows a better way to display class scheldules please let me know.

^ this is what I have so far that actually displays data from the database

^ this is what i'd like it to look like
This is the code that I have of right now
I'm having problem displaying it so that each ID person is displaying their full scheldule routinely one after another
feyd | Please use
Problem: I managed to display everything perfectly. The only problem is displaying the scheldules in a decent viewable way. If anyone knows a better way to display class scheldules please let me know.

^ this is what I have so far that actually displays data from the database

^ this is what i'd like it to look like
This is the code that I have of right now
Code: Select all
<?PHP
$query = "SELECT * FROM _app ORDER BY id ";
$result = mysql_query($query) or die ("Query failed");
//let's get the number of rows in our result so we can use it in a for loop
$numofrows = mysql_num_rows($result);
?>
<?PHP
echo "<TABLE BORDER=\"1\" cellpadding=\"3\" >\n";
echo "<TR bgcolor=\"lightgreen\"><TD>ID:</TD><TD>IP Address:</TD><TD>Date:</TD><TD>Name:</TD><TD>Birthday:</TD><TD>Class Of:</TD><TD>Shirt Size:</TD><TD>GPA:</TD><TD>Periods:</TD><TD>Subject:</TD><TD>Teacher:</TD><TD>Room:</TD></TR>\n";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
echo "<TR bgcolor=\"lightblue\">\n";
} else { //if there isn't a remainder we will do the else
echo "<TR bgcolor=\"white\">\n";
}
echo "<TD>".$row['id']."</TD><TD>".$row['ip']."</TD><TD>".$row['date']."</TD><TD>".$row['fname']." ".$row['lname']."</TD><TD>".$row['bday']."</TD><TD>".$row['class']."</TD><TD>".$row['shirt']."</TD><TD>".$row['gpa']."</TD><TD>".$row['sdfsfd']."</TD></Tr>\n";
echo "</TR>\n";
}
//now let's close the table and be done with it
echo "</TABLE>\n";
?>feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]