PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Note: You would go a long way and save yourself a lot of time if you did some reading up on html, and definitely worth using CSS - constructive comment
$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) WHERE Job_Name='Manager'";
$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></hr>
<tr>
<td>" . $jname . "</td>
<td>" . $jskill . "</td>
</tr>
<tr>
<td>Weight</td>
<td>" . $weight . "</td>
</tr>
<td>" . $pname . "<td>
<td>" . $pskill . "</td>
</tr>
</tr>
<td>Score<td>
<td>" . $score . "</td>
</tr>
</table>");
}
}
By adding this WHERE clause in the Job_Name, I was hoping to display a table where all the skills required and their weights are displayed...something like this:
also i want to display each person as a different table, so for example if my database has two people, bob and dave, then there will be one table with the Manager Skill Name, the weight and Daves Score, then another table with Manager Skill Name, Weight and Toms Score....
I am not 100% sure what you want and I am not familiar with your schema, but it should definitely make it easier to achieve many things as you wont have nested loops.