mtgriffiths Posted March 21, 2008 Share Posted March 21, 2008 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 Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 21, 2008 Share Posted March 21, 2008 and the correct layout involves dancing clowns feeding penguins on the moon? Quote Link to comment Share on other sites More sharing options...
mtgriffiths Posted March 21, 2008 Author Share Posted March 21, 2008 The layout i mean is that all the data falls into the correct field in the table Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 21, 2008 Share Posted March 21, 2008 move the closing table tag outside the while loop. Quote Link to comment Share on other sites More sharing options...
Caesar Posted March 21, 2008 Share Posted March 21, 2008 and the correct layout involves dancing clowns feeding penguins on the moon? Probably one of the top 5 best posts I've seen on these boards since I signed up :-P Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.