php help

Ok im trying to help my Friend with a project i looks easy but im no PHP master

The task is to set up a small webpage for a local football team

The page needs to be able to store football fixtures and results dynamically using php

The sql table

Create Table "tblresults’ (
‘date’ Date NOT NULL
‘Team’ VARCHAR(50) NOT NULL
‘result’ VARCHAR(10) NULL
) ENGINE = MYISAM;

Create Table ‘tblResults’
‘Username’ VARCHAR(20) NOT NULL,
‘Password’ VARCHAR(100) NOT NULL,
PRIMARY KEY (‘username’)
) ENGINE = MYISAM;

1 its asking to create a logon screen that allows the administrator before they
can do tasks like add delete and modify records

2 Two create necessary files to alow a record to be inserted into the database to add
the fixtures of games, you must ensure that the necessary fileds are completed
and provide the user with the approprate feed back

3 Create the necessary files for a user to delete a record you must ensure that the user has a are you sure option giving the correct feedback

4 create a file that allows the vistor to list all records (fixtures and scores) from the database

I know this is not that hard but if anyone can help me with linking pages to a database i will reward you

thanks Ben

Hi Ben,

This all quite simple, depending on how much php you know!

The login form is easy, you need to forms, one to register a user, and the second to login the user, and once logged in redirect him to a page for viewing results, adding and deleting etc.

To add a result you need a form with some error checking, this can simply be to check if any of the fields are blank and if so printing a message on screen

To delete a result you would need to check that the user is sure they wish to delete it, this is probably easiest in javascript but can be done in php, if you just want to add a checkbox to the form so the user confirms that they wish to delete

Finally to show all results you just need to echo all the results from the database into a table using a while loop.

I would also add another field in the tblresults section with an auto_increment id, that way when you delete a field you can do it by the id, or as a fail save move it to another table so the user can also view and restore results they may have accidentally deleted even with a confirmation.

I am more than happy to do this for you, just pm me your offer :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service