LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-29-2003, 10:48 PM   #1
jhorvath
Member
 
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Rep: Reputation: 30
MySQL data type


Programming question...you decide...

anyway, i'm having some trouble understanding some mysql data types...
in general :

tinyint(NUM)

in NUM , am i specifiying the MAX number ...ie tinyint(4) ranging from 0-3 (unsigned that is)

or am i specifying the number of bits/bytes used to store the tiny little integer?

on the mysql website , for BOOL they use tinyint(1)...that confused me even more..

maybe the explanation was given on that site somewhere and i just missed it, but if anyone can help clarify this that'd be swell.

as always, thank you

Last edited by jhorvath; 06-29-2003 at 11:39 PM.
 
Old 06-30-2003, 05:56 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Re: MySQL data type

Quote:
Originally posted by jhorvath
tinyint(NUM)

in NUM , am i specifiying the MAX number ...ie tinyint(4) ranging from 0-3 (unsigned that is)

or am i specifying the number of bits/bytes used to store the tiny little integer?
The number is the display size, the (minimum) number of digits to display. This can used for example for zero-padding (0004 instead of 4 )
 
Old 06-30-2003, 10:05 PM   #3
jhorvath
Member
 
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Original Poster
Rep: Reputation: 30
Hko,

thank you very much for clarifying that for me, i'm following along with an article on creating an online document management system :

http://www.devshed.com/Server_Side/PHP/Cracking/

(good article if anyone's interested) ...and i was having trouble figuring out what the author was doing with these 'tinyints'.

thanks alot,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What kind of program should I use... r_squared Linux - Software 3 03-07-2005 10:08 AM
Loving Linux.. need a kind word of advice tho please!! :) crazytigger Linux - Newbie 6 09-22-2004 06:19 PM
What kind of Frames Per Second should i get? mitchmiller Linux - Hardware 1 06-01-2004 01:42 AM
What kind of X? alitrix Slackware 6 06-13-2003 03:59 AM
I need some kind of alarm carrja99 Linux - Software 3 02-16-2003 01:05 AM


All times are GMT -5. The time now is 11:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration