View Full Version : Display record from database

07-24-2008, 09:15 PM
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

$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

07-24-2008, 09:19 PM
I wanted to add. If I do it this

$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'