If I have a prepared statement as follows:
$stmt = $mysqli->prepare( "SELECT fielda, fieldb, fieldc, from tablea where $option = ?" )
Is it possible to prepare the $option
variable as well?
Note: the $option
variable comes from a drop down list as follows
<select name="option">
<option value="blah1">blah1</option>
<option value="blah2">blah2</option>
<option value="blah3">blah3</option>
<option value="blah4">blah4</option>
</select>
and the other field comes from a simple input text box. This field will fill up the ?
in the prepared statement.