I need to get some data to repeat itself underneath where it is.
It's in a table. If i just repeat the code underneath the last code it will only return one lot of data. The part of code in blue needs to be repeated and output again.
Code:
[COLOR=Navy]$res="SELECT * FROM survey WHERE rtid=1 ORDER BY id";
$results= mysql_query($res,$connection);
$num= mysql_num_rows($results);
for ($i=0; $i<$num; $i++) {
// Fetch data from survey table here
$rows= mysql_fetch_array ($results);
$s='';
$t='';
$u='';
$array_name= 'myradio'.$rows['id'];
if (isset($POST[$array_name])) {
foreach ($POST[$array_name] as $key => $val) {
if ($val=='Currently In Place') $s='X';
else if ($val=='Required Essential') $t='X';
else if ($val=='Required-Recommended') $u='X';
//////////////////////////////////////////////////////////
$line[$i][0] = $rows['requirement_txt'];
$line[$i][1] = $s;
$line[$i][2] = $t;
$line[$i][3] = $u;
$line[$i][4] = "Module 1";[/COLOR]
}}}
$line[$i][0] = "2. Financial";
$line[$i][1] = "";
$line[$i][2] = "";
$line[$i][3] = "";
$line[$i][4] = "";
return $line;