Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    25
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Display record from database

    I have a problem and I can't figure out how to get around it.

    I have entries in my MySQL database for the users country. but for some reason when they are placed into the database they are done so in a odd way. If you look at the image below you will see what I mean.



    At the bottom it says the users country, but for some reason when it is inserted into the database it is done in like a TEXT type, but the it is set for varchar. It should look like what wifi there is.

    But anyway I'm trying to get a php script to display that record, when it is that way it is above, it will not display it in the script. If I manually put the country in, the table will look just like the one with wifi in it does, and it will display fine.

    Is there any other way I need to write my line of code I use so it will pull that in?

    I'm using this
    Code:
    $folder_sql = mysql_query("SELECT test_key from user_results WHERE  country = 'United States' ");
    If I change the country type over to TEXT it does the same thing.

    Thank You

  • #2
    New Coder
    Join Date
    Jul 2008
    Posts
    25
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I wanted to add. If I do it this

    Code:
    $folder_sql = mysql_query("SELECT country from user_results WHERE testid = 269890 ");
    It will tell me the country from that testid just fine, it won't show me anything tho when I ask it to get something from a specific country, with WHERE country = 'Inset Country Name'


  •  

    Posting Permissions

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