full location name is not coming from drop down
Posted: Tue Jun 08, 2010 11:50 pm
Hello friends
i am not getting the full location name. this location name i want to use as a key for further search.
I want to get the full location name but i am getting its part before first space.
i.e. if location is south africa , I am getting south
please help me in getting the full location name.
i am not getting the full location name. this location name i want to use as a key for further search.
I want to get the full location name but i am getting its part before first space.
i.e. if location is south africa , I am getting south
please help me in getting the full location name.
Code: Select all
<table>
<td>Select Location: </td>
<td>
<?php
$query="SELECT DISTINCT location FROM faculty_incharge WHERE PSRN=$psrn";
/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */
$result = mysql_query ($query);
echo "<select name='location' value=''>Location Name</option>";
// printing the list box select command
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[location]>$nt[location]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
?>
</td>
</tr>