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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:29:58+00:00 2026-05-25T09:29:58+00:00

In my INNODB mySQL database I have some columns named like active, verified, disabled

  • 0

In my INNODB mySQL database I have some columns named like active, verified, disabled among others like name, surname.

To explain it better

Column      Type         Null  Default
expires     int(10)      Yes   NULL
verified    tinyint(1)   Yes   NULL
disabled    tinyint(1)   Yes   NULL

When a user logins into my page, I use PHP and check for example

if ($row['disabled']) { }

to know if he is disabled ( NULL or 1 ). (there are only these 2 possibilities).

For now, I set them as NULL but I thought if it is better to use 0 instead, knowing that 0 is empty in PHP too.

Concluding, my questions are two.

  1. Does thousands NULL records grow without a reason the DB instead of thousands 0 records?
  2. Does NULL or 0 affects PHP execution’s performance differently ? If so, what is the best combination of mySQL and PHP to have for the requested checks as above?

Update

On my question number 1, my question is if NULL is actually null of size, otherwise is +3 bytes right?

  • 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-25T09:29:58+00:00Added an answer on May 25, 2026 at 9:29 am

    In mysql, NULL values mean that a particular field has no value in it or it is empty. Ideally, if you have a field like Name and Address and don’t want to assign values to them all the time, you can state that it’s default value is NULL.

    But if you’re talking about only two possibilities like a True or False item, it’s best to go for the Boolean field that is most space efficient.

    Going further, for fields like Booleans (eg: disabled) and dates (eg: DateJoined) it’s not advisable to keep them as null or unassigned. You can bump into problems in the future if you had to interface with another language like VB. For example, if you try to read an assigned date field via VB, you’ll see that your app crashes. But through PHP, this is not a problem. To be on the safe side, it’s best to assign a default true or false (1 or 0) value for such fields.

    And finally, to CHECK for null values, the normal relational operators are not suitable. Rather, you should use the IS NULL or IS NOT NULL operator instead.

    More info here: http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html

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

Sidebar

Related Questions

I have a MySQL innodb database at 1.9GB, showed by following command. SELECT table_schema
I have an enormous MySQL (InnoDB) database with millions of rows in the sessions
I have a MySQL-InnoDB table with 350,000+ rows, containing a couple of things like
I have a MySQL InnoDB table with 238 columns. 56 of them are TEXT
In my MySQL InnoDB database, I have dirty zip code data that I want
Here's some background info. I have three MySQL tables (all InnoDB). The first table
I'm currently developing a web application using MYSQL database InnoDB format and need some
I have a mySQl innodb database which has a couple of tables which store
I would like to know if it's possible in InnoDB in MySQL to have
I have a MySQL database that has on the order of 400 million innodb_data_pending_reads

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.