Football tables

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jetpacmidge
Forum Newbie
Posts: 1
Joined: Wed Jan 19, 2005 9:29 am
Location: Reading, Berkshire

Football tables

Post by jetpacmidge »

Hi,

I am creating an interactive website where an administrator enters the football results which automatically updates the tables.
I am using MYSQL, PHP and Apache webserver which I am a new user.

So far i have created the tables and managed to in 8O put results into the database but am stuck in how to show the updated tables each time a result is entered.

Copy of creating tables script.

create database Tadburnfc;
#use Tadburnfc;
#show databases;
#show tables;
use Tadburnfc;
#drop table results;
#drop table leagueTable;
create table results (
season CHAR(10) NOT NULL,
age CHAR(15) NOT NULL,
homeTeam CHAR(30) NOT NULL,
awayTeam CHAR(30) NOT NULL,
fixtureDate DATE NOT NULL,
homeScore INT(3) UNSIGNED NOT NULL,
awayScore INT(3) UNSIGNED NOT NULL,
PRIMARY KEY(season, age, homeTeam, awayTeam) );
create table leagueTable (
season CHAR(10) NOT NULL,
age CHAR(15) NOT NULL,
team CHAR(30) NOT NULL,
played INT(4) UNSIGNED NOT NULL,
won INT(4) UNSIGNED NOT NULL,
lost INT(4) UNSIGNED NOT NULL,
drawn INT(4) NOT NULL,
goalsfor VARCHAR(4) NOT NULL,
goalsagainst VARCHAR(4) NOT NULL,
points INT(3) NOT NULL,
PRIMARY KEY(season, age, team) );
show tables;
describe results;
describe leagueTable;

Any help in how to show the updated tables on the website would be much appreciated.
Thanks.

If someone could point me in the right direction on the PHP code to use for example I would be grateful.

Thanks for any help to my problem.

Rgds,

Andy M
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

showing a given table's contents is most often, a simple SELECT command.

You may want to read some tutorials about MySQL SELECTS, including our own in the tutorial section.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Re: Football tables

Post by JAM »

jetpacmidge wrote:If someone could point me in the right direction on the PHP code to use for example I would be grateful.
What feyd sais, and adding that I'd also recommend the PHP manual and not to forget, it's usercomments.
mysql_fetch_array() is a very place to start, but the rest of the MySQL php functions should not be forgotten.
Post Reply