I'm tring to pull data from my MySQL DB and dynamically populate a drop down menu containing the Names of the users (note that to the user it will appear has one name however in the DB the names are stored separately as user_fname and user_lname), this is the code I have:
echo"<select name=\"select_user\" tabindex=\"1\">";
echo "<option value=\"blankuser_submitted\">- SELECT USER -
</option>";
while($row = mysql_fetch_array($dropDownMenu_usersTABLE_result))
{
echo "<option value=$row["user_fname"]." ".$row["user_lname"]>$row["user_fname"]." ".$row["user_lname"]</option>";
}
I keep getting this error:
Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\apache\htdocs\file.php on line 32
This is line 32:
echo "<option value=$row["user_fname"]." ".$row["user_lname"]>$row["user_fname"]." ".$row["user_lname"]</option>";
I kno it's not a problem with the DB because this works perfectly (but as U can see that aint a drop down menu )
while($row = mysql_fetch_array($dropDownMenu_usersTABLE_result))
{
echo $row["user_fname"]." ".$row["user_lname"];
echo "<br />";
}