Jump to content


Photo

newbie here


  • Please log in to reply
8 replies to this topic

#1 Greaser9780

Greaser9780
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 29 August 2006 - 09:41 AM

I want to create a table with the following:
CREATE TABLE bhd_singles (
clanid int(25) NOT NULL auto_increment,
clan_name varchar(25) NOT NULL default '',
last_battle NOT NULL default '0000-00-00 00:00:00',
wins
losses
streak
rank

I am not sure what commands to put in to define data on the last four rows. Can somebody help me?

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 August 2006 - 09:57 AM

Use INT if those last four rows hold a number.

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 29 August 2006 - 02:34 PM

And probably UNSIGNED, too.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 Greaser9780

Greaser9780
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 30 August 2006 - 07:51 AM

where can I find info on how to use those? as in what area in this site?

#5 paul2463

paul2463
  • Members
  • PipPipPip
  • Advanced Member
  • 955 posts
  • LocationUK

Posted 30 August 2006 - 08:31 AM

http://www.phpfreaks...umn-Types/2.php
you cannot affect the past but you can ruin a perfectly good present by worrying about the future

*********************************************************************
The <A HREF="http://www.php.net/d...php">MANUAL</A> is actually a useful resource

#6 Greaser9780

Greaser9780
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 01 September 2006 - 09:27 AM

OK neither of what I was told to use was on that list


#7 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 01 September 2006 - 11:00 AM

...
wins
losses
streak
rank

I am not sure what commands to put in to define data on the last four rows. Can somebody help me?


Use INT if those last four rows hold a number.


So, do they hold a number? If so, of what size? If not, what is going to go in each of those fields.

First you help us, then we help you.
Legend has it that reading the manual never killed anyone.
My site

#8 Greaser9780

Greaser9780
  • Members
  • PipPipPip
  • Advanced Member
  • 326 posts

Posted 05 September 2006 - 06:42 AM

Yes they will all hold numbers.Wins will be 1-120, Losses will be 1-50 streak will be 1-100 and rank is actually a math problem dividing losses by wins( not sure if this belongs in the table or not)

#9 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 05 September 2006 - 01:00 PM

Yeah, UNSIGNED SMALLINT will probably do the trick... and no, I wouldn't store the rank in this table -- if anything, if another summary table.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users