Results 1 to 2 of 2

Thread: Select * from error

  1. #1
    Join Date
    Mar 2009
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Select * from error

    WHY wont this work?

    Instead of displaying the zipcode, city, & state

    and stuff, it says Array() :S

    Code:
    <?
    $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:

    Code:
    local
    zip_code
    state_abreviation
    latitude
    longitude
    city
    state
    thanks!

    ~Shadow~

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    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?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •