trying to combine first and last name for drop down menu. Got it working for on but it does not work with two!!! i can get a $fullname to print but not in the menu...
any help would be great.
code:
<?
include("../conf.php");
include("../functionstwo.php");
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$resulttwo=mysql_query("SELECT first_name, last_name_FROM_users ORDER BY first_name");
while ($row = mysql_fetch_array($resulttwo)) {
$first_name = $row['first_name'];
$last_name = $row['last_name'];
if ($first_name != "") {
$fullname = trim("$first_name $last_name");
} else {
$fullname = trim("$last_name");
}
$display_story .= "$fullname, $first_name $last_name<BR>";
$row_array=mysql_fetch_row($resulttwo);
$string='<select name=photographers><option value=>pick photographer</option>';
for ($i=0;$i<mysql_num_rows($resulttwo);$i++)
{
if ($row_array[0]=="")
{
$row_array=mysql_fetch_row($resulttwo);
}
else{
$string .='<option value="'.$row_array[0].'">'.$row_array[0];
$row_array=mysql_fetch_row($resulttwo);}
}
}
$string .='</SELECT>';
echo $string;
echo "<br>
$display_story";
?>