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 9112665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:47:22+00:00 2026-06-17T03:47:22+00:00

there is a problem with my MySQL query. I have a table with one

  • 0

there is a problem with my MySQL query. I have a table with one of the columns “read” where the values are “1” by default and is automatically set to tinyint(1) by phpmyadmin instead of bool.

When I perform a query:

SELECT * FROM book WHERE read = '1'

It gives an error.

But when I perform this query:

SELECT * FROM book WHERE id = '77'

It is fine. I don’t see any problem except that maybe tinyint cannot be searched that way. Can someone please help? I’ve travelled across google but found no answers.

  • 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-06-17T03:47:23+00:00Added an answer on June 17, 2026 at 3:47 am

    just remove the quotes

    as it is tinyint you should not use quote (use them for strings or characters or dates)

    select * from `table_name` where `read`=1;
    

    if it doesn’t work then you can do casting as mentioned by Ilion ( it’s good )

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

Sidebar

Related Questions

Hi there I have big problem with one select query There is a table:
In one of my MySQL tables, I have following columns: Skills varchar(80) Industry varchar(40)
I have a problem inserting a row in a MySQL table when the table
I have the following problem: In mysql I have a table which contains two
I have an optimisation problem with a fairly large table (~1.7M rows). There are
I am encountering one little problem here: I am entering one MySQL query through
I have a MySQL database with a table called sources , there I have
I have a php script that process keywords from a mysql table keywords (columns:
Let's say we have a table with columns DAY and NUMERO. There can be
I have a MySQL table with many numeric columns (some INT, some FLOAT). I

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.