Hello i use the following code for extracting some info from the database
Each field that is returned must have a radio button and a dialog box at the end on the table row.
Do u know how can i do that?
$query = "SELECT topic.top_id, top_name, staf_lname, topic.top_diff FROM topic, staff, top_staff WHERE staff.staff_id = top_staff.staff_id and topic.top_id = top_staff.top_id ORDER BY top_name ";
$db = new mysqli('localhost','root','323232');
$db -> select_db('project');
$result = $db->query($query);
if ($result->num_rows >0 )
{
// if they are in the database register the user id
$SESSION['valid_top1'] = $top1;
$SESSION['valid_top2'] = $top2;
$SESSION['valid_top3'] = $top3;
$SESSION['valid_top4'] = $top4;
$_SESSION['valid_top5'] = $top5;
}
$num_results = mysqli_num_rows($result);
print "<table >";
echo '<td class = header colspan = 4>Number of Projects found: '.'<strong>'.$num_results.'</td>';
?>
<tr>
<td class = header> Topic ID </td>
<td class = header> Topic Title </td>
<td class = header> Supervisor Last name </td>
<td class = header> Difficulty </td>
</tr>
<?php
print "<tr>";
$i=0;
while($i < $total_cols){
print "<td>";
print $row[$i];
print "</td>";
$i++;
}
print "</tr>";
while($row = mysqli_fetch_row ($result)) {
$i = 0;
print "<tr>";
while($i < $total_cols){
print "<td>";
print $row[$i];
print "</td>";
$i++;
}
print "</tr>";
}
?>
thanks