$check = mysql_query('SELECT * FROM course_completion_criteria GROUP BY module');
foreach($check as $c)
{
$module = $c->module; //echo $module;
if($module == 'quiz')
{
$query1 = mysql_query('SELECT * FROM table1');
echo '<table>
<th>Name</th>
<th>Time</th>
foreach($query1 as $q)
{
$name = $q->name;
$time = $q->time;
echo '<tr><td>'.$name.'</td>
<td>'.$time.'</td>
</tr>';
}
echo '</table>';
}
if($module == 'scorm')
{
$query2 = mysql_query('SELECT * FROM table2');
echo '<table>
<th>Name</th>
<th>Time</th>
foreach($query1 as $q)
{
$name = $q->name;
$time = $q->time;
echo '<tr><td>'.$name.'</td>
<td>'.$time.'</td>
</tr>';
}
echo '</table>';
}
}
The above code should work case 1 : If $module is test1 case 2 : If $module is test2 case 3 : If $module is both test1 and test2
My code isn't working in CASE 3 and it displays two tables, but i want 2rows in the same table Could anyone help me?
$modulebe both "test1" and "test2" at the same time?