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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:13:57+00:00 2026-06-17T19:13:57+00:00

can I know why it is not inserting zero to my database when its

  • 0

can I know why it is not inserting zero to my database when its type in integer. I have a table called contact and there is a column to keep users’ 10 digits length mobile no. This number generally start with 0. Eg. 0713423454, 0234324545 etc.

In my table I have create that column like this..

mobile INT(10) NOT NULL, 

In php I validate it something like this…

// Check for a mobile number:
if ( !empty($_POST['mobile'])) {
    $number = $_POST['mobile'];     
    if (preg_match('/(0[0-9]{9})/', $number)) {
        $mobile = mysqli_real_escape_string ( $dbc, $number);
    } else {
        $reg_errors['mobile'] = 'You are NOT entered valid Mobile number!';
    }
} else {    
    $reg_errors['mobile'] = 'Mobile number can not be empty!';
}

But when inserting mobile number to database its going without 0 like this 234223434, 435453545 etc.

So I would like to know is there a way to insert my mobile number with 0 to database..

Thank you.

  • 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-17T19:13:58+00:00Added an answer on June 17, 2026 at 7:13 pm

    Integers do not (cannot) have leading zeros. That is, both ‘099’ and ’99’ represent the same numeric value1.

    Use a char or varchar instead.


    1 Sometimes a leading zero in the text-representation of a number specifies the [octal] base, but that is not the case here.

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

Sidebar

Related Questions

My database have a profile table with image column. I want to set the
I have a table where a int column should either be set to zero
How can I skip a column when inserting a new row into a table
I need create clone repository. but I do not know where can I get
I know you can not set a key value dynamically, but what about the
I know I can read off /proc/[id]/maps but I'm not sure if the first
I know you can use -fno-objc-arc flag to disable ARC for files that NOT
I know I can combine tables with sql queries, but that's not what I
I want to know i can do something similar to this (not working) code
This question is not language-aware. I wanna know how can I recognize a returning

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.