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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.