Ask a Question related to PHP Development, Design and Development.
-
Steven #1
MySQL question.
Try to create a MySQL tables and don't know how to decide the type of some
fields:
Key: SSN - use int/bigint/char ?
PhoneNumber - int/bigint/char ...?
The reason I asked is that I got a space used exceed the limit with just one
row...
Thanks in advance
Regards,
-Steven
Steven Guest
-
dbi::mysql question
Hi I have need to log data from a bunch oc secure trustix/linux machines these machines are minimally configured and purpose built to be NMS... -
Mysql Question. Can Someone Help
Hello Fellow Members, I am new to perl and Mysql. I want to set up a mysql table to take Email addresses, and randomly place them into a payment... -
PHP + MYSQL Question!
PHP_Kid wrote: It'd be a *lot* easier to answer your question(?) if you just told us what input you're expecting, instead of having us swim... -
A MySQL question
Ok, I want to delete only 1 row off of a database table... Example: I have a table with columns "user" and "item"... Lets say the table contains... -
OT: MySQL question
Hi, Sorry about the off topic post, but my news server doesn't carry any decent MySQL newsgroups and it seems that many people using PHP are... -
Steven #2
Re: MySQL question.
"Marcus" <JumpMan222@aol.com> wrote in message
news:3F066B10.5030909@aol.com...some> Steven wrote:> > Try to create a MySQL tables and don't know how to decide the type ofone> > fields:
> >
> > Key: SSN - use int/bigint/char ?
> > PhoneNumber - int/bigint/char ...?
> >
> > The reason I asked is that I got a space used exceed the limit with justThanks Marcus !>> > row...
> >
> > Thanks in advance
> >
> > Regards,
> > -Steven
> >
> >
> Steven,
>
> I would just use char for both... I have stored phone numbers and just
> use char(12) for 000-000-0000. If you want to use an integer type, int
> would be the smallest size that would fit a 9 digit SSN... using
> UNSIGNED should give you a range up to 2^32-1. I believe you would need
> a bigint for a 10 digit phone number... again use UNSIGNED, as that
> should give you up to 2^64-1. Hope that helps.
>
> Marcus
>
>
I have to use bigint for the phonenumber before I change it to char...
-Steven
Steven Guest
-
Andy Hassall #3
Re: MySQL question.
On Sat, 05 Jul 2003 05:29:21 GMT, "Steven" <xueming@comcast.net> wrote:
Phone numbers are strings, not really numbers, so definitely use varchar.>Try to create a MySQL tables and don't know how to decide the type of some
>fields:
>
>Key: SSN - use int/bigint/char ?
> PhoneNumber - int/bigint/char ...?
>
>The reason I asked is that I got a space used exceed the limit with just one
>row...
Depends how you store them, but even if you don't have characters like (, ), -
and spaces in them, leading zeros are significant, so you don't want them
disappearing if you used a numeric datatype.
Don't know what the rules on SSNs are to say one way or the other, though.
--
Andy Hassall (andy@andyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
Space: disk usage analysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
Andy Hassall Guest
-
Geoff Berrow #4
Re: MySQL question.
Message-ID: <lacdgv4k4u9tu9b4dnv1r496b72naeb8aa@4ax.com> from Andy Hassall
contained the following:
My students always make this mistake. I usually ask them "could you use it> Phone numbers are strings, not really numbers, so definitely use varchar.
>
> Depends how you store them, but even if you don't have characters like (, ), -
>and spaces in them, leading zeros are significant, so you don't want them
>disappearing if you used a numeric datatype.
in a calculation?" If no, it's not a number.Same applies, I'd say.>
> Don't know what the rules on SSNs are to say one way or the other, though.
--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs [url]http://www.ckdog.co.uk/rfdmaker/[/url]
Geoff Berrow Guest
-
Steven #5
Re: MySQL question.
"Geoff Berrow" <$bl$@ckdog.co.uk> wrote in message
news:suqegvcdsjj33n61h1piqfgco989hmcsci@4ax.com...varchar.> Message-ID: <lacdgv4k4u9tu9b4dnv1r496b72naeb8aa@4ax.com> from Andy Hassall
> contained the following:
>> > Phone numbers are strings, not really numbers, so definitely use(, ), -> >
> > Depends how you store them, but even if you don't have characters likeit>> >and spaces in them, leading zeros are significant, so you don't want them
> >disappearing if you used a numeric datatype.
> My students always make this mistake. I usually ask them "could you usethough.> in a calculation?" If no, it's not a number.> >
> > Don't know what the rules on SSNs are to say one way or the other,Thank you both and that is a very good point !!>
> Same applies, I'd say.
>
> --
> Geoff Berrow
> It's only Usenet, no one dies.
> My opinions, not the committee's, mine.
> Simple RFDs [url]http://www.ckdog.co.uk/rfdmaker/[/url]
It took me almost two hours to figure out that I need bigint to store the
phone number 9727121049, if I use int, it always changed to 214..... which
I guess is the largest number for int. After I use bigint, it works fine,
but I don't feel that is right though :)
Thanks again.
-Steven
Steven Guest



Reply With Quote

