I have a database called usCities with fields loc_Id, city_Name, state_Ab, state_Id all as text fields. I have a query that creates a temp array of only cities in a specific state based on state_Id. I then query this temp array to find the specific city line I am looking for to return the loc_Id I have assigned to that city. When I run the queries in mysql from phpmyadmin they work but when I convert it into php it doesn’t. Here’s my php code: where $state and $city come from a form option dropdown box
[php]
$line2=mysql_query(“SELECT DISTINCT * FROM usCIties WHERE state_Id =$state”);
$result4=mysql_fetch_array($line2);
$line3=mysql_query(“SELECT * FROM $result4 WHERE city_Name = $city”);
$result4 = mysql_fetch_array($line3);
$LocId=$result4([‘loc_Id’];
[/php]
I have tried this line but the combo returns nothing but blank page. The above at least returns my other page $result info from working code.
[php]
$line2=mysql_query(“SELECT DISTINCT * FROM usCIties WHERE state_Id =$state AND city_Name = $city”);
[/php]