Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7550569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:14:45+00:00 2026-05-30T10:14:45+00:00

Never come across this before, just cannot understand the reasoning behind it. I have

  • 0

Never come across this before, just cannot understand the reasoning behind it.

I have a query:

SELECT * FROM (`user`) WHERE `user_email` = 0 AND `user_pass` = 0

This shows all rows, even though I would have read the query as ‘Show me all records which have the integer 0 in both user_email and user_pass. Why is that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:14:47+00:00Added an answer on May 30, 2026 at 10:14 am

    You put integer 0, so it converts your varchar fields user_email and user_pass to int. Actually, if non-null string doesn’t have leading number on it, it will be converted to 0. For example,

    SELECT 'aaaa' = 0; // returns 1 - true
    SELECT '1aaa' =0; // 0 -false
    SELECT '1aaa' =1 ;// 1 -true
    

    Correction. According to docs, they will be compared as float, not as integers.

    In all other cases, the arguments are compared as floating-point (real) numbers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have come across this problem before and I have never understood the reasoning
I've never come across this before: I have a series of text boxes. The
Weirdly, I've never come across this issue before, but I've just started making a
I bet this is probably basic stuff, I've just never come across it before.
I've never come across this extension before. It's being used for a front-end interface
Has anyone ever come across this? I've never seen it before. I know there
I've never come across this before, but how would you test whether three variables
Something weird I've never come across before. I wrote this function for one of
I have never seen this issue before, its very strange. Just wondering if anyone
While answering this question I noticed that I have never come across any property

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.