Hello There!
I've created a data base with 4 columns "city, zipcode, dfw, love) 2 of these columns should be visible on my web page: http://www.riva-limo.com/rates.php
After the surfer is choosing the airport from the drop-down list he should see "Select a city..." in the next field and then he will be able to choose from a drop-down list of cities.
My problem is that it seems that the information from the data base is loaded to that field but it is not visible, and if you blindly select from the cities list you can see the same problem happening again in the zip code field.
My code looks like this:
if ($_GET['act']=='getCity') {
$query_city = "SELECT DISTINCT city FROM rates ORDER BY city ASC";
$city = mysql_query($query_city, $db) or die(mysql_error() ." " .$query_city);
$row_city = mysql_fetch_assoc($city);
//$totalRows_groups = mysql_num_rows($groups);
$options[] = "{optionValue: '', optionDisplay: 'Select a City...'}";
do {
$options[] = "{optionValue:'".$row_city['city']."', optionDisplay: '".htmlentities(trim($row_city['city'])) ."'}";
} while ($row_city = mysql_fetch_assoc($city));
Here's the above code in [php] tags, hopefully making it easier for myself and others to read it and then maybe help you:
PHP Code:
if ($_GET['act']=='getCity') {
$query_city = "SELECT DISTINCT city FROM rates ORDER BY city ASC";
$city = mysql_query($query_city, $db) or die(mysql_error() ." " .$query_city);
$row_city = mysql_fetch_assoc($city);
//$totalRows_groups = mysql_num_rows($groups);
$options[] = "{optionValue: '', optionDisplay: 'Select a City...'}";
do {
$options[] = "{optionValue:'".$row_city['city']."', optionDisplay: '".htmlentities(trim($row_city['city'])) ."'}";
} while ($row_city = mysql_fetch_assoc($city));
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
You need to close the <option> tag with its closing ">" before the optionDisplay call.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Thanks Guys,
I've tried to re saved the PHP files and replaced them on the server and it started functioning again, I've posted "for the time being" because I had this phenomenon earlier and it stopped functioning after a while... I'm hoping that it will last now.
Thank you for willing to help me!
Have a nice day!
Chilik
Bookmarks