Solved

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

Posted on 2013-06-05
1
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 110

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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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 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 …

632 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