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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:37:20+00:00 2026-06-15T12:37:20+00:00

I am currently using tinyint to store boolean values in mysql, and am trying

  • 0

I am currently using tinyint to store boolean values in mysql, and am trying to query a database but it is failing. The error I am getting is Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given which if im not mistaken just means the query didn’t work. Before I post the query let me say I am using practically deprecated php for the query, however it’s not going live and I just need it to work real quick. I know this stuff is all being updated so feel free to share any relevant materials (I do need to get caught up as it is) however the solution I am looking for is for my old school query. The query is:

$sql = mysql_query("SELECT * FROM contact ORDER BY id ASC WHERE read='0'");

where read is the tinyint in question.

I have tried WHERE read=0
and WHERE read=false

None of these are working, I do appreciate any help in advance!

  • 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-15T12:37:22+00:00Added an answer on June 15, 2026 at 12:37 pm

    You need to structure the query correctly:

    "SELECT * FROM contact WHERE read=0 ORDER BY id ASC"
    

    WHERE comes before ORDER BY.

    Additionally, “mysql_num_rows() expects parameter 1 to be resource” is happening because you’re calling a method on a failed query – not a resource. You could get a proper error on your query itself with something like mysql_query("SELECT... your query") or die(mysql_error()) But officially we all suggest moving to PDO or mysqli
    And using their respective error reporting utilities.

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

Sidebar

Related Questions

Currently I'm using Tinyint(1) to indicate Boolean values in my MySQL databases, which I
I have a MySQL database which currently uses a tinyint field to store the
Currently using a MySQL database Wanting to insert a new row into a table
Currently using Google Analytics as a supplement to our paid tracking software, but neither
Currently using MySQL version 5.1.6 This is my first real world build and so
I am currently using Ubuntu 11.10 and java SE 1.6.0_26. I am trying to
We're currently using the following for creating US dollar values in our web application:
heres what I'm currently using: Rails -v 3.2.3 I'm trying to make a path
Currently using: @^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$ How can i make http:// not compulsory but if it does
I have the following prepared query I am using with mysql and php. It

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.