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!
I think the following code can help you, check it out.
$sql = "SELECT * FROM ID_Table WHERE Job_ID IN (SELECT Job_ID FROM Job_ID WHERE Job_ID ='1')";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);//counts the total results of the query
$num_fields = mysql_num_fields($result);//table's columns count
print "<table>";
print "<tr>";
for ($a=0;$a<$num_fields;$a++)
{
print "<td>" . mysql_field_name($result,$a) . "</td>";//print column name
}
print "</tr>";
for ($b=0;$b<$num_rows;$b++)
{
$data = mysql_fetch_array($result);
print "<tr>";
for ($c=0;$c<$num_fields;$c++)
{
print "<td>" . $data[$b][mysql_field_name($result,$c) ] . "</td>";
}
print "</tr>";
}
print "</table>";