Hello everyone,
I used session and the id of the selected checkbox are passed to another page currently.
now I do another query based on the ID of the selected checkbox.
I want to display the fields from the selected result in columns like this
http://www.bluenile.co.uk/diamond_co...OMPARISON_STEP
I did this
<?
foreach($acb as $key => $value)
{
echo 'The value of $_SESSION['."'".$key."'".'] is '."'".$value."'".' <br />';
//print out the values
$query = "SELECT * from lesson WHERE lessonID ='".$value."'" ;
$result = mysql_query( $query, $con);
$result_array = mysql_fetch_array($result);
//echo $query;
// for each pice of info saved in array, display it to users
echo '<table>';
foreach($result_array as $key => $value)
//while($row = mysql_fetch_array($result_array))
{
if (!is_int($key))
{
echo '<tr><td>Lesson ID</td><td>'.$result_array['lessonID'].'</td></tr>';
echo '<tr><td>Year</td><td>'.$result_array['year'].'</td></tr>';
echo '<tr><td>Subject</td><td>'.$result_array['subject'].'</td></tr>';
echo '<tr><td>Learning Area</td><td>'.$result_array['learningArea'].'</td></tr>';
echo '<tr><td>Topic</td><td>'.$result_array['topic'].'</td></tr>';
echo '<tr><td>Learning Outcome</td><td>'.$result_array['LO'].'</td></tr>';
}
}
echo '</table>';
}
?>
the result returned like this
Lesson ID 52
Year 4
Subject ICT
Learning Area Computer Systems
Topic Hardware
Learning Outcome Storage
Lesson ID 52
Year 4
Subject ICT
Learning Area Computer Systems
Topic Hardware
Learning Outcome Storage
Lesson ID 52
Year 4
Subject ICT
Learning Area Computer Systems
Topic Hardware
Learning Outcome Storage
it is loops for several times before showing the next records from the selected checkbox (also several times).
I want to have them displayed in columns like the example above.
can anyone help?
thankyou