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:

Did you know?Explore Trending and Topic pages for more stories like 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

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

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

recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

Unidentified index error in a simple form
I have been trying to make an HTML form that is handled by a PHP script. So far my attempts to get i

How to show more than 1 users with this code...
Hello,
i have a table that shows users only if I, as Administrator, want to be shown. But its sho

Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....

Warning: session_start() [fu

Why doesn't this work? (SSH2)
This is my script:

Code: <?php
$connection = ssh2_connect('213.251.167.109', 22);

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

Array help
Hello i got this code to fetch data from database but it is not working it displays
7
Array

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