-1

Currently trying to write data from my dropdown menu to a field on my database. All the text fields are populating perfectly, but not sure why the drop down data isn't.

This is my code:

Mucca019
  • 201
  • 1
  • 3
  • 16

2 Answers2

0

You have invalid syntax here.

$returned = $_POST['returned']; // This returns null.

You can always change your loans table of the $returned field to nullable.

OR, you can just fix it by replacing..

<select>
  <option value="No"> No </option>
  <option value="Yes"> Yes</option>
</select>

To

<select name="returned">
  <option value="No"> No </option>
  <option value="Yes"> Yes</option>
</select>
choz
  • 17,242
  • 4
  • 53
  • 73
0

Change your <select> tag to this

<select name="returned">
...
</select> 

you have to give the name of the parameter