mysql VARCHAR acting like INT


Posted on 16th Feb 2014 07:03 pm by admin

Hi, All.

I have a table that contains a varchar(10) column named weird_field. In this column, only integers reside (e.g., 3010101009). When I do this:

Line number On/Off | Expand/Contract select * from table where weird_field = '3010101009'

no records are returned, even though there is a record with weird_field = '3010101009'.

However, if I do this:

Line number On/Off | Expand/Contract select * from table where weird_field = 3010101009

the appropriate records are returned. I don't think this should be the case, right? Because it's a varchar column, shouldn't the 3010101009 be quoted? It's messing up some joins I'm trying to do, and I just don't get it.

Thanks

No comments posted yet

Your Answer:

Login to answer
284 Like 49 Dislike
Previous forums Next forums
Other forums

MySQL query problem
When I try to run the following piece of code, I get this error:
QuoteWarning: mysql_query(): sup

problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

Rounding a number queried from a database
I know that to display a rounded number you just do echo "round($number)";. But how would

Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

2 things: enter doesn't work in IE & empty form
i have this search form that works well except for 2 things.

1) on IE when i hit enter instea

Doubles are giving me problems
Ok so, first of all i made a double = 0.05, but when running the debugger it shows up as 0.04999. I

gettext translates ALWAYS?
I'm using gettext with the new version of XAMPP (5.3.0) on Windows Seven RTM (build 7600)
gettext

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash