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

generating random codes
Hi guys n gals,

I have a requirement to generate 250,000 unique codes...

These codes a

Show message after entering data
Hello Colleagues

I would like to display messages after entering the data example: "
dat

Adding to an Int row in db
Hi, i have a database which houses all of the users of my site. One of the columns is for points whi

Variable Clash
In the past I've had variables clash. For example:

Code: <?php
$c = 5;
$ca

Regular expression tips or resources
Hello! I'm having some issues implementing the appropriate regex patter to eliminate unwanted charac

server trace logs
could any one tell me from where do i get error logs in xMII??I want to check the reason for dtabase

undefined offset help
Hi All,

I kept getting undefined offset PHP notice for a simple for loop. For eg
$va = arr

How to Detect it is public_html or httpdocs?
How to check whether it is cPanel or Plesk?

If it found public_html perform <?php incl

C++ API to Oracle dB
I need to perform a select command to the Oracle dB to obtain information from a table.
What libr

php ajax - two drop down list with a submit button
i have created a form with 2 drop-down list and a submit button. I would like to know how to pass th

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