Jump to content

Printing out a table


mtgriffiths

Recommended Posts

Hi All,

 

I am tryin to print out a table depending on the results of my query.

 

All the information echos out correctly but i cant get the layout correct what so ever.

 

The code im using is:

 

<?php
$Search = mysql_query("SELECT DISTINCT students.Enrollment, students.First_Name, students.Last_Name, student_attendance.Student_ID, student_attendance.Date FROM students INNER JOIN student_attendance ON students.Student_ID = student_attendance.Student_ID WHERE student_attendance.Date = '$Date'")or die(mysql_error());
?>

<?php
echo "<table border='0'>";
echo "<tr align='center'>";
echo "<td width='20%'><font color='#FFFFFF' face='Calibri'>";
echo "Enrollment No";
echo "</td><td width='20%'><font color='#FFFFFF' face='Calibri'>";
echo "First Name";
echo "</td><td width='20%'><font color='#FFFFFF' face='Calibri'>";
echo "Last Name";
echo "</td><td width='20%'><font color='#FFFFFF' face='Calibri'>";
echo "Date";
echo "</td></tr>";

while($myrow = mysql_fetch_array($Search))
{
echo "<tr align='center'>";
echo "<td><font color ='White' face = 'calibri'>";	echo $myrow['Enrollment'];
echo "</td><td><font color ='White' face = 'calibri'>";	echo $myrow['First_Name'];
echo "</td><td><font color ='White' face = 'calibri'>";	echo $myrow['Last_Name'];
echo "</td><td><font color ='White' face = 'calibri'>";	echo $myrow['Date'];
echo "</td></tr>";
echo "</table>";
}
?>

 

Can any one help me?

 

Thanks

 

Matthew

Link to comment
https://forums.phpfreaks.com/topic/97281-printing-out-a-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.