0
if($region==region){

$result = mysql_query("SELECT * FROM places");
$row = mysql_fetch_assoc($result);
 
echo "zone: ".$row['zone'].";
}
4
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by Lejonet
0

What are you trying to do?

if($region==region){

should probably be

if($region=="region"){

or

if($region==$region){

who knows..

0

i mean to say that there's a selection box which have region values. so, whenever the region value is selected, the zone selection values from that region value has to come in the zone selection from the database. i tried that code and it didn't select from the database. i was writing that if the region is selected it must retrive its zone values of the database. this is what i mean...

0

So you want the query to run if a selection is made?

if(isset($region)){
$result = mysql_query("SELECT * FROM places");
$row = mysql_fetch_assoc($result);
 
echo "zone: ".$row['zone']."";
}
0

If I understand you right.

You want to show the zone from a certain region.

$query = "Select * from places where region = '$region' LIMIT 1";
$result = mysql_query($query);
$row = $mysql_fetch_row($result);

echo $row;

should work. No if.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.