just wondering - does anyone know how i can change this self-populating script so that i can choose more than one selection from my database to go into a field ?
<?php
$table="scholarship"; // name of the table
$limit="20"; // limit # of records in select box
$orderBy="level"; // Usually a column name
$conn = pg_connect("","","","","funds");
if
(!$conn)
{echo "Could not make a connection";exit;}
$sql = "SELECT DISTINCT level FROM $table order by $orderBy;";
$select_box = pg_Exec($conn, $sql);
$numrecords = pg_NumRows($select_box);
echo "<select name=select>";
//pre selected option
echo"<option value=\"none\">select type</option>";
//loop through database to populate select box
for ($j=0; $j < $numrecords; $j++) {
$value = pg_result($select_box, $j, "level"); //column name for the value of the checkbox
$option = pg_result($select_box, $j, "level"); // select option column name
echo"<option value=\"$value\">$option</option>";
}
echo"</select>";
?>
and will i have to do something to my database in order for this to work when more than one selection is made ????? thanks for any help that anyone can offer.