Problems with my table
Posted: Mon Mar 23, 2009 6:43 pm
Hi guy I am having trouble outputting my data into a html table, my code is:
But this doesnt work very well... I want a table with the folowing columns:
$jskill $weight $pskill $score
Thanks
Code: Select all
$sql= "SELECT * FROM Person_Skill
JOIN Person_ID USING (Person_ID)
ORDER BY Person_Name";
$result1 = mysql_query($sql)
or die ("Couldn't execute query.");
while ($row=mysql_fetch_array($result1))
{
$pname=$row['Person_Name'];
$pskill=$row['Skill_Name'];
$score=$row['Score'];
$sql2= "SELECT * FROM ID_Table
JOIN Job_ID USING (Job_ID)
ORDER BY Job_Name";
$result2 = mysql_query($sql2)
or die ("Couldn't execute query.");
while ($row1=mysql_fetch_array($result2))
{
$jname=$row1['Job_Name'];
$jskill=$row1['Skill_Name'];
$weight=$row1['Weight'];
}
echo"
<table width='200' border='1'><hr>
<strong>$pname</strong> <br></br>
<tr bgcolor='#999999'> <div align='center'>
</tr>
<tr>Skill_Name
<td>$jskill</td>
</tr>
<tr>Score
<td>$weight</td>
</tr>
<tr>Skill_Name
<td>$pskill</td>
</tr>";
}
$jskill $weight $pskill $score
Thanks