Is this possible?

admin

Administrator
Staff member
Howdy,

Here's what I have: a table containing zone_1, zone_2, zone_3 and zone_4 as the column names. Let's say I have a variable called $zone which equals 4 already.

I want to use mysql to select the zone_4.

Here's what doesn't work...

$result = mysql_query("SELECT * FROM table_name WHERE zone_$zone='$zone'",$db);

Question is, is there anyway in the mysql statement to make it select from zone_4?

I was thinking of $test='zone_'.$zone; but that didn't work...

Help?
 
Back
Top