Current location: Hot Scripts Forums » Programming Languages » PHP » Newbie MySQL

Newbie MySQL

Reply
  #1 (permalink)  
Old 03-16-04, 07:53 AM
fccolon fccolon is offline
Newbie Coder
 
Join Date: Mar 2004
Location: West Mids. UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Newbie MySQL

Hi,

I'm looking to set up a racing league site.....suprisingly there are no scripts out there to crib from - well none that I could find.

This is my 1st attempt at php/mysql, so could someone have a look at this set of mysql tables and let me know whether I'm going in the right direction ?

Cheers

# PHP Version: 4.1.2
#
# Database : `gpldb`
#

# --------------------------------------------------------

#
# Table structure for table `GPL_league`
#
# Creation: Mar 10, 2004 at 01:33 AM
# Last update: Mar 10, 2004 at 01:33 AM
#

CREATE TABLE `GPL_league` (
`id` tinyint(2) unsigned NOT NULL auto_increment,
`League_name` varchar(30) NOT NULL default '',
`League_descr` varchar(250) default NULL,
`cur_sid` int(4) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

#
# Dumping data for table `GPL_league`
#


# --------------------------------------------------------

#
# Table structure for table `GPL_division`
#
# Creation: Mar 10, 2004 at 01:33 AM
# Last update: Mar 10, 2004 at 01:33 AM
#

CREATE TABLE `GPL_division` (
`id` int(4) NOT NULL default '0',
`div_name` varchar(50) NOT NULL default ''
) TYPE=MyISAM;

#
# Dumping data for table `GPL_division`
#

# --------------------------------------------------------

#
# Table structure for table `GPL_season`
#
# Creation: Mar 10, 2004 at 01:35 AM
# Last update: Mar 10, 2004 at 01:35 AM
#

CREATE TABLE `GPL_season` (
`id` int(4) NOT NULL default '0',
`seasonname` varchar(30) NOT NULL default '',
`notracks` int(2) NOT NULL default '0',
`descr` varchar(250) NOT NULL default '',
PRIMARY KEY (`id`,`id`),
KEY `seasonname` (`seasonname`,`id`)
) TYPE=MyISAM COMMENT='Season details';

#
# Dumping data for table `GPL_season`
#


# --------------------------------------------------------

#
# Table structure for table `GPL_points`
#
# Creation: Mar 09, 2004 at 10:46 PM
# Last update: Mar 09, 2004 at 10:46 PM
# Last check: Mar 09, 2004 at 10:46 PM
#

CREATE TABLE `GPL_points` (
`id` int(3) NOT NULL default '0',
`points_1` tinyint(2) unsigned NOT NULL default '9',
`points_2` tinyint(2) unsigned NOT NULL default '6',
`points_3` tinyint(2) unsigned NOT NULL default '4',
`points_4` tinyint(2) unsigned NOT NULL default '3',
`points_5` tinyint(2) unsigned NOT NULL default '2',
`points_6` tinyint(2) unsigned NOT NULL default '1',
`points_7` tinyint(2) unsigned NOT NULL default '0',
`points_8` tinyint(2) unsigned NOT NULL default '0',
`points_9` tinyint(2) unsigned NOT NULL default '0',
`points_10` tinyint(2) unsigned NOT NULL default '0',
`points_11` tinyint(2) unsigned NOT NULL default '0',
`points_12` tinyint(2) unsigned NOT NULL default '0',
`points_13` tinyint(2) unsigned NOT NULL default '0',
`points_14` tinyint(2) unsigned NOT NULL default '0',
`points_15` tinyint(2) unsigned NOT NULL default '0',
`points_16` tinyint(2) unsigned NOT NULL default '0',
`points_17` tinyint(2) unsigned NOT NULL default '0',
`points_18` tinyint(2) unsigned NOT NULL default '0',
`points_19` tinyint(2) unsigned NOT NULL default '0',
`points_20` tinyint(2) unsigned NOT NULL default '0',
`points_pole` tinyint(2) unsigned NOT NULL default '0',
`points_FL` tinyint(2) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Points table';

#
# Dumping data for table `GPL_points`
#

# --------------------------------------------------------

#
# Table structure for table `GPL_drivers`
#
# Creation: Mar 10, 2004 at 01:17 AM
# Last update: Mar 10, 2004 at 01:17 AM
#

CREATE TABLE `GPL_drivers` (
`id` int(4) NOT NULL default '0',
`usrname` varchar(20) NOT NULL default '',
`driver_name` varchar(30) NOT NULL default '',
`race_firstname` varchar(10) NOT NULL default '',
`race_initial` char(1) NOT NULL default '',
`race_lastname` varchar(20) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `usrname` (`usrname`,`race_firstname`)
) TYPE=MyISAM COMMENT='Driver names';

#
# Dumping data for table `GPL_drivers`
#


# --------------------------------------------------------

#
# Table structure for table `GPL_lsdp`
#
# Creation: Mar 10, 2004 at 12:36 PM
# Last update: Mar 10, 2004 at 12:36 PM
#

CREATE TABLE `GPL_lsdp` (
`lid` int(2) NOT NULL default '0',
`sid` int(4) NOT NULL default '0',
`divid` int(4) NOT NULL default '0',
`pid` int(5) NOT NULL default '0'
) TYPE=MyISAM COMMENT='League, Season, Division, Points x-ref';

#
# Dumping data for table `GPL_lsdp`
#

# --------------------------------------------------------

#
# Table structure for table `GPL_drv_div`
#
# Creation: Mar 10, 2004 at 12:36 PM
# Last update: Mar 10, 2004 at 12:36 PM
#

CREATE TABLE `GPL_drv_div` (
`did` int(5) NOT NULL default '0',
`divid` int(4) NOT NULL default '0'
) TYPE=MyISAM COMMENT='Driver, Division x-ref';

#
# Dumping data for table `GPL_drv_div`
#

# --------------------------------------------------------

#
# Table structure for table `GPL_circuits`
#
# Creation: Mar 10, 2004 at 12:37 PM
# Last update: Mar 10, 2004 at 12:37 PM
#

CREATE TABLE `GPL_circuits` (
`id` int(4) NOT NULL default '0',
`track_name` varchar(30) NOT NULL default '',
`track_country` varchar(30) NOT NULL default '',
`FL_time` time NOT NULL default '00:00:00',
`did` int(4) NOT NULL default '0',
`FL_date` date NOT NULL default '0000-00-00',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Circuit details';

#
# Dumping data for table `GPL_circuits`
#

# --------------------------------------------------------

#
# Table structure for table `GPL_race_one`
#
# Creation: Mar 10, 2004 at 01:25 AM
# Last update: Mar 10, 2004 at 01:25 AM
# Last check: Mar 10, 2004 at 01:25 AM
#

CREATE TABLE `GPL_race_one` (
`id` int(5) NOT NULL default '0',
`sid` int(3) NOT NULL default '0',
`divid` int(4) NOT NULL default '0',
`cid` int(4) NOT NULL default '0',
`race_date` date NOT NULL default '0000-00-00',
`pract_lngth` int(3) NOT NULL default '0',
`race_lngth` int(3) NOT NULL default '0',
`result_loc` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;

#
# Dumping data for table `GPL_race_one`
#


# --------------------------------------------------------

#
# Table structure for table `GPL_race_result`
#
# Creation: Mar 10, 2004 at 06:12 PM
# Last update: Mar 10, 2004 at 06:12 PM
# Last check: Mar 10, 2004 at 06:12 PM
#

CREATE TABLE `GPL_race_result` (
`id` int(4) NOT NULL default '0',
`roid` int(5) NOT NULL default '0',
`divid` int(4) NOT NULL default '0',
`sid` int(4) NOT NULL default '0',
`cid` int(4) NOT NULL default '0',
`did` int(5) NOT NULL default '0',
`pos_qualify` char(2) NOT NULL default '',
`pos_race` char(3) NOT NULL default '',
`time_to_finish` time NOT NULL default '00:00:00',
`time_qualify` time NOT NULL default '00:00:00',
`time_race` time NOT NULL default '00:00:00',
`avg_time_race` time NOT NULL default '00:00:00',
`distance_to_first` time NOT NULL default '00:00:00',
`laps_comp` int(3) NOT NULL default '0',
`race_chassis` varchar(10) NOT NULL default '',
`laps_led` int(3) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;

#
# Dumping data for table `GPL_race_result`
#
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-16-04, 10:39 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,250
Thanks: 0
Thanked 0 Times in 0 Posts
good tables' structures depends on how your script gonna work ..
you need to plan how you wanna run your script and then make yout tables to fit them ..
__________________
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-16-04, 10:54 AM
fccolon fccolon is offline
Newbie Coder
 
Join Date: Mar 2004
Location: West Mids. UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by NeverMind
good tables' structures depends on how your script gonna work ..
you need to plan how you wanna run your script and then make yout tables to fit them ..
Ah right.......haven't even started on the script......thought if i had the structure looking right I would build from there...Heyho
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Totally ignorant newbie needs help! Dawn_M_74 The Lounge 3 03-06-04 10:09 AM
mysql crash IMPORTANT comby PHP 0 03-02-04 10:27 AM
great product for dumping/recovering MySQL databases Dave Brown General Advertisements 1 10-03-03 07:40 AM
MySQL with PHP question. HELP for a newbie kenfused PHP 3 08-02-03 12:53 AM


All times are GMT -5. The time now is 05:38 PM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.