Solved

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

Posted on 2013-06-05
1
385 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 108

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now