Log in

View Full Version : Select * from error



ShadowIce
05-01-2009, 12:11 PM
WHY wont this work?

Instead of displaying the zipcode, city, & state

and stuff, it says Array() :S


<?
$zmydb = mysql_connect("localhost", "root", "Pass") or die(mysql_error());
$mydb=mysql_select_db("weather") or die(mysql_error());
$blah = mysql_query("SELECT * FROM location WHERE city = zip_code") or die(mysql_error());
$info = mysql_fetch_array( $blah ) or die(mysql_error());
?>
<?echo "<select style=\"font-weight:bold;margin:0 0 0 0;padding:0 0 0 0;\" name=\"here\" id=\"here\"><option value=".$info.">".$info."</option></select>";?>

table name is location

column names:


local
zip_code
state_abreviation
latitude
longitude
city
state

thanks!

~Shadow~

forum_amnesiac
05-04-2009, 08:41 AM
Can you clarify something for me.

You are doing a query on a table where the field named city equals the field named zip_code.

Are you trying to see if there has been some incorrect entries?