Php Separated Table

Hi there, I have a create a table for the list of the course taken by university student with the grade point. But all the courses with all grade point are in a table but I need the courses with the grade point of 4.00 to be displayed in another table. How do I do that?

The look of the table (Web):

Code for the table (php design):

<?php  }else{ ?>
<!-- Result Transcript Title -->
<table width="818" border="0" align="center" cellpadding="0" cellspacing="0"><!-- 1 -->
<tr align="center">
<td colspan="2"height="23"><strong style="font-size: 14px; color: #E0FFFF;">Result Transcript</strong></td>
</tr>
<tr>
<td width="725" height="31" align="right">
<form id="form2" name="form2" method="post" action="">
<input name="transcript" type="hidden" id="transcript" value="add" />
<input name="lect_id" type="hidden" id="lect_id" value="<?php echo $row_lecturer['lect_id']; ?>" />
<input name="id" type="hidden" id="id" value="lect" />
<input name="y" type="hidden" id="y" value="stu" />
<input name="stu" type="hidden" id="stu" value="student" />
<input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
<label>
<input name="button10" type="image" id="button10" value="Add" src="image/button_add1.gif" align="top" />
</label>
</form>
</td>
<td width="93" height="31" align="right">
<form id="backform" name="backform" method="post" action="">
<input name="y" type="hidden" id="y" value="year" />
<input name="id" type="hidden" id="id" value="lect" />
<input name="lect_id" type="hidden" id="lect_id" value="<?php echo $row_lecturer['lect_id']; ?>" />
<label>
<input name="button8" type="image" id="button8" value="Submit" src="image/button_back1.gif" align="top" />
</label>
</form>
</td>
</tr>
</table>
<!-- Result Transcript Title -->
<!-- Result Transcript Table -->
<table width="818" border="1" align="center" cellpadding="1" cellspacing="1">
<tr>
<td width="97" height="22" align="center" valign="middle"><strong style="color: #FFD700">Session</strong></td>
<td width="123" height="22" align="center" valign="middle"><strong style="color: #FFD700">Course Type</strong></td>
<td width="369" height="22" align="center" valign="middle"><strong style="color: #FFD700">Course</strong></td>
<td width="73" height="22" align="center" valign="middle"><strong style="color: #FFD700">Grade</strong></td>
<td height="22" align="center" valign="middle"><strong style="color: #FFD700">Pointer</strong></td>
<td width="75" height="22" align="center" valign="middle"><strong style="color: #FFD700">Action</strong></td>
</tr>
<?php
$num=0;
do {
if($num%2==0){
$color="#D6F5F5";}else{
$color="#FFFFCC";}
$num+=1;
?>
<tr><!-- 5 -->
<td width="97" height="18" align="center" style="font-size: 11px; color:#FFFFFF; font-weight:normal"><?php echo $a1=$row_transcript['academic_year']; ?></td>
<td width="123" height="18" align="center" valign="middle" style="font-size: 11px; color:#FFFFFF; font-weight:normal"><?php echo $a2=$row_transcript['course_type']; ?></td>
<td width="369" height="18" style="font-size: 11px; color:#FFFFFF; font-weight:normal" align="left">&nbsp;<?php echo $a3=$row_transcript['course_id']; echo " - ";
$zzz = mysql_query("SELECT * FROM course WHERE course_id='$a3'");
if($zzz = mysql_fetch_assoc($zzz)){
echo $xxx=$zzz['course_name'];} ?>
</td>
<td width="73" height="18" align="center" style="font-size: 11px; color:#FFFFFF; font-weight:normal"><?php echo $a4=$row_transcript['grade_id']; ?></td>
<td width="48" height="18" align="center" style="font-size: 11px; color:#FFF; font-weight:normal">
<?php $a5=$row_transcript['grade_id'];
$zzz = mysql_query("SELECT * FROM grading WHERE grade_id='$a5'");
if($zzz = mysql_fetch_assoc($zzz)){
echo $xxx=$zzz['grade_pointer'];} ?>
</td>
<td width="75" height="18" align="center" style="font-size: 11px;">
<form id="form7" name="form7" method="post" action="">
<label>
<input name="button18" type="image" id="button18" value="Submit" src="image/butn_edit.gif" align="top" />
</label>
<input name="transcript" type="hidden" id="transcript" value="edit" />
<input name="y" type="hidden" id="y" value="stu" />
<input name="id" type="hidden" id="id" value="lect" />
<input name="lect_id" type="hidden" id="lect_id" value="<?php echo $row_lecturer['lect_id']; ?>" />
<input name="stu" type="hidden" id="stu" value="student" />
<input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
<input name="transcript_id" type="hidden" id="transcript_id" value="<?php echo $row_transcript['transcript_id']; ?>" />
</form>
</td>
</tr>
<?php } while ($row_transcript = mysql_fetch_assoc($transcript)); ?>
</table>
<!-- Result Transcript Table-->
<?php  } ?>

The look of the table (php design):

Form code(php design)

<form id="form2" name="form2" method="post" action=""><strong style="color:#FFF">&nbsp;&nbsp;
<label>
<input type="image" src="image/b_view.gif" name="button7" id="button7" value="Submit" align="top" />&nbsp;&nbsp;<u>Result Transcript</u>
</label></strong>
<input name="id" type="hidden" id="id" value="lect" />
<input name="y" type="hidden" id="y" value="stu" />
<input name="stu" type="hidden" id="stu" value="student" />
<input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
</form>

The look of the link (php design)

Please advise and guide. thanks in advance.

Think it’s time for the important lesson of JOIN’s in your queries :wink:
What’s your database structure, and do you want the courses with 4.0’s to appear in BOTH tables, or only the second?