I'm not sure what exactly you're trying to do here.
What is the value of $nt['question']? I realise it's pulled from your database but unless you have a database entry named 'question2' you will never be able to access the data in the way you have tried. If you're trying to load in data and then work out what the user has pressed, perhaps to make some sort of questionairre then I suggest using HTML / PHP arrays, take the following:
Code: Select all
<?php
# Page one
// Start form
echo '<form action="page2.php" method="post">';
$query = mysql_query("SELECT * FROM guestbook ORDER BY question DESC") or die(mysql_error());
// Loop through
while($row = mysql_fetch_assoc($query)){
echo '<p>'.nl2br($row['dtl']).'<br /><input type="checkbox" name="question[]" value="'.$row['question'].'" /></p>
}
// Close form
echo '</form>';
?>
And to process the code...
Code: Select all
<?php
# Page 2
// Print a formatted array
echo '<pre>'.print_r($_POST, true).'</pre>';
?>
Page one will run through your database and output the 'dtl' (which i assume is 'detail') along with a checkbox. Each checkbox is named 'question[]' which means it will populate an array named 'question', each checked checkbox will have it's own entry in that array with the value found in value="". You'll see what I mean when you view page2.
I'm not sure whether this is what you were after but your description wasn't too clear.
Mike