Hi,
I have populated a dropdown menu using php pdo from sqlite database. How would i go about reading what the user has selected in the dropdown menu. so i can do something like:
$userSelected = [whatever user selected in the dropdown menu];
my code is as follows (part of it):
<form name="placementStudents" method="post"><br />
<select name = 'studentrow'>
<?php
$db = new PDO('sqlite:mydb.sqlite');
$getStudents= $db ->query("SELECT this part works");
$rowarray2 = $getStudents->fetchAll();
$studentrow = 0;
foreach($rowarray2 as $row)
{
echo "<option value = $studentrow>$row[studentID] $row[firstName] $row[lastName]</option>";
$studentrow++;
}
?>
<input type="submit" value="Select Student">
</select>
</form>
(removed the sql select statement as it was quite long, but it does work)
Thanks.