Jump to content

[SOLVED] select value not being passed


will35010

Recommended Posts

I have two php functions that generate options for select menus. The menu displays properly, but the value isn't being passed.

 

The value is supposed to be $row['dl']

function getDrivers() {
require('opendb.php');
$result = mysqli_query($conn, "SELECT fname, lname, dl FROM drivers");

while($row = mysqli_fetch_array($result))
{
  echo "<option value=\"" . $row['dl'] . "\">".$row['lname'].",".$row['fname']."</option>";
}
}

The value is supposed to be $row1['vin']

function getVehicles() {
require('opendb.php');
$result1 = mysqli_query($conn, "SELECT vin, plate, year FROM vehicles");
while($row1 = mysqli_fetch_array($result1)) {
echo "<option value=\"" . $row1['vin'] . "\">".$row1['plate'].",".$row1['year']."</option>";
}
}

Link to comment
https://forums.phpfreaks.com/topic/160708-solved-select-value-not-being-passed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.