Welcome to WebmasterWorld Guest from 22.214.171.124
I'm back with yet another question. I have a dropdown in my script(The dropdown is populated by a function) that contains 3 words. When I go to insert the selected option into MYSql, for some reason, it only picks up the first word of the 3.
For example, let's say that the drop down listed types of vehicles. In this case, the selected option was "Dodge Grand Caravan". When I echo the variable "vehicle" from the function, all I get in return is "Dodge".
Thanks as always!
Here is the function...
$result = mysql_query("Select * from " . $tablename . " Order by Name");
die('Invalid formation of select query in displaydropdownvalues(): ' . mysql_error());
echo "<select name=" . $dropdownname . ">";
echo "<option value='' selected></option>";
while ($row = mysql_fetch_array($result, MYSQL_BOTH))
echo "<option value=" . $row . ">" . $row . "</option>";
Here is where I call and display it in the table...
<td colspan="2"><label for="vehiclename">Vehicle:</label></td>
<td colspan="2"> <name="vehiclename" id="vehiclename" tabindex="3"/><?php vehicle("vehicle", "Name");?></td>
Then when I load it into the query for insert into MySQL, I only get the first word. I know it has something to do with the space, but not sure how to correct it....