From: andy amol
I am using the following code, but it is not populating my script. If
you can help I would be grateful.
I am using mysql as database.
?
$sql = SELECT course_id FROM course;
$sql_result = mysql_query($sql)
or die(Couldn't execute query.);
while ($row =
I use html forms with select field size 1 and the option values and/or
what is supposed to appear in the box. This you populate by your DB
query, maybe using an array and a loop (from 0 to ..).
Torsten
andy amol schrieb:
hi,
I would like to know how to create and populate drop down boxes in
You mean select/select html dropdown-s?
print 'select name=sg';
$r = mysql_query(SELECT id, field1, fieldn FROM table WHERE fieldn = 'sg');
while($RESULT = mysql_fetch_array($)) {
print 'option value='.$RESULT['id'].''.$RESULT['fieldn']'./option';
}
print '/select';
Validating: just check
From: andy amol [EMAIL PROTECTED]
I would like to know how to create and populate drop down boxes in php.
I want the value to be populated from database.
What I am try to do is to provide the forign key value as combo box
option, so that I do not have to check for referential integrity.
If it is a MySWL database, the following code works great
?
$sql = select choice, description from views;
$result = mysql_query($sql) or die(mysql_error());
$viewing = ;
$viewing .= select name=\view_code\\n;
while ($view_list = mysql_fetch_array($result))
{
$view_code = $view_list[choice];
hi,
I am using the following code, but it is not populating my script. If you can help
I would be grateful.
I am using mysql as database.
?
$sql = SELECT course_id FROM course;
$sql_result = mysql_query($sql)
or die(Couldn't execute query.);
while ($row = mysql_fetch_array($sql_result))