Quote:
Originally Posted by nelson.cabral
Wow that was quick! Thank you!
If I want to set the list of all threads in a specific forum as a dropdown question items, is it also possible?
|
Custom Question
php code:
PHP Code:
$answer = '<select name="'.$formbit[id].'">';
$answer .= '<option></option>';
$thisanswer = $q_{$formbit[id]};
$threads = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "thread
WHERE forumid = '10'
ORDER BY title ASC");
while($row = $db->fetch_array($threads)) {
$answer .= '<option value="'.$row[threadid].'"';
if ($row[threadid] == $thisanswer) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[title].'</option>';
}
$answer .= '</select>';
(Change forumid = '10' to the forumid you want)
Quote:
EDIT : more generally is it possible to generate forms choices with php?
|
What do you mean?