Jump to content

[SOLVED] Drop down box with info from Mysql


$username

Recommended Posts

Hello all,

    I am looking to have a drop down box populated from data from MySQL.

I would like to have first name and last name in the value.

Is there something I am doing wrong?

 

echo "<option value=\"{.$row150['UserFirstName']..$row150['UserLastName'].}\"{$selected}>{$row150['UserFirstName']}</option>";

 

$sql150 = "SELECT UserFirstName, UserLastName FROM users";
//$sql150 = "SELECT CompState FROM standardvalues";
if ($result150 = mysql_query($sql150)) {
  while ($row150 = mysql_fetch_assoc($result150)) {
    $selected = ($row150['UserFirstName']==$ContactState)?" selected=\"selected\"":"";
   echo "<option value=\"{.$row150['UserFirstName']..$row150['UserLastName'].}\"{$selected}>{$row150['UserFirstName']}</option>";
  }
}

echo      " </select>
      </div></td>

 

Thanks

Brett

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.