adlep
12-07-2002, 07:00 PM
Hello!
I do have a dynamic form script which generates the list of the tables (chapters) being present in my MySQL database.
It works just fine, but I have problem after enabling multivalue option in my script... How to modify my script so it can pass more than one variable into the next script? (User selects few tables instead of just one, so something like that
$chapter =$_POST[chname] will not work anymore because it can not hold more than one selection)
I was thinking about array but got lost...
Help.
Here is the script:
$counter = 0;
$table_list = mysql_list_tables($dbname); // lists tables
echo "or, just select chapters (amount of material) for the exam:";
print (" <p> ");
echo "<form method=\"post\" action=\"chapterlist.php\">"; // dynamic form code starts here!
echo "<select name= \"chname\" multiple>";
while ($row =mysql_fetch_row($table_list))
{
echo "<option name=\"$dbname\">";
echo $result = mysql_tablename($table_list, $counter);
echo "</option>";
$counter++;
}
echo "<input type=\"Submit\" Value=\"Submit\"></form>";
?>
Like I said most likely I would have to incorporate an array into this script...but how?
I do have a dynamic form script which generates the list of the tables (chapters) being present in my MySQL database.
It works just fine, but I have problem after enabling multivalue option in my script... How to modify my script so it can pass more than one variable into the next script? (User selects few tables instead of just one, so something like that
$chapter =$_POST[chname] will not work anymore because it can not hold more than one selection)
I was thinking about array but got lost...
Help.
Here is the script:
$counter = 0;
$table_list = mysql_list_tables($dbname); // lists tables
echo "or, just select chapters (amount of material) for the exam:";
print (" <p> ");
echo "<form method=\"post\" action=\"chapterlist.php\">"; // dynamic form code starts here!
echo "<select name= \"chname\" multiple>";
while ($row =mysql_fetch_row($table_list))
{
echo "<option name=\"$dbname\">";
echo $result = mysql_tablename($table_list, $counter);
echo "</option>";
$counter++;
}
echo "<input type=\"Submit\" Value=\"Submit\"></form>";
?>
Like I said most likely I would have to incorporate an array into this script...but how?
