Thread: fetch array problems
Results 1 to 5 of 5
03-13-2004, 12:26 PM #1
fetch array problems
First, I am new to this site/forum and somewhat familiar with PHP.
I am attempting to modify a database and it's functions from a project that I had a company develop (nearly 3 yrs ago.) - I thought this would be simple. (wrong?)
This is what I am trying to accomplish.
db consists of one table and 23 fileds.
It is a list of locations with their info.
I want to have it retrieve a list of cities within a State & Country or if no State then just Country.
Further, the city must be a select option in a form.
if (($country == "USA" || $country == "Canada") && $state == "")
redirect("<br><br>You need to select the state/province first. Taking you to the state selection area.","?action=selectState&country=$country");
if ($country == "USA" || $country == "Canada")
echo "<center><br>State: ".$states[$state].", $country</font>";
echo "<FORM action='?action=display' method=post>
<INPUT TYPE='hidden' NAME='country' VALUE='$country'>
<INPUT TYPE='hidden' NAME='state' VALUE='$state'>";
if ($country == "USA" || $country == "Canada" && $states == "$state")
$citydb1 = mysql_query("SELECT city FROM db WHERE state='$state', country='$country' ORDER BY city ASC");
$cities = mysql_fetch_array($citydb1);
$citydb2 = mysql_query("SELECT city FROM db WHERE country='$country' ORDER BY city ASC");
$cities = mysql_fetch_array($citydb2);
echo "<select name='city'>
Any ideas or suggestions.
03-22-2004, 01:05 PM #2
I have attempted several times and several ways to make this function. All to no avail.
Does anyone have an idea of how to get this to function?
03-31-2004, 02:56 PM #3
I am sorry nobody has been able to help you. Hopefully you have solved your problem by now?
04-12-2004, 07:21 AM #4
Not really - I am hiring a database developer to assist me though...
Oh well, I appreciate the place to ask... I will check in time to time...
05-23-2004, 03:01 PM #5
Can you be more specific on whats the problem
and can you show me the error you are getting.