Solved

drupal schema type int length 3 but get int(10)

Posted on 2013-06-05
1
388 Views
Last Modified: 2013-07-10
want to have a int(3) field.
In drupal schema, define as:
      'response_code' => array(
        'description' => 'The API response code',
        'type' => 'int',
        'length' => 3,
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),

But it creates int(10) field in mysql database.
CREATE TABLE `log` (
  `response_code` int(10) unsigned DEFAULT NULL,
)
0
Comment
Question by:drupal_100
1 Comment
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39222156
Length of an INT is not really relevant.  Integers are numbers and they don't have any inherent length.  They have maximum and minimum values.  Strings have length.

Why does this matter to you?  There might be a different approach, if we understand your concern about a length of 3.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question