I would like to populate a dynamic select option in page 2 of my webform based on the value of another select option in the previous page. I would like to use a variable in db_query, and hence tried this. But it doesn't work. I am not sure where I went wrong. Kindly let me know how I could solve this problem.
$array = array();
$major = $form_values['submitted_tree']['choose_your_major'];
$sql = db_query("SELECT data FROM webform_submitted_data WHERE nid = 2133 and cid =23 and data = '%s'", $major);
while($row = db_fetch_object($sql)) {
$array[] = $row->data;
}
return $array;
webform_submitted_data
table contains datas at this point ? – tostinni Dec 29 '11 at 23:03