Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Data - Need Application/Solution

Status
Not open for further replies.

bitdaf

IS-IT--Management
Feb 23, 2003
37
US
Hi all,

Here is the problem:

Each week we dump all of our high school scores into our news updater and post. It looks like this:
It's hard to read and very hard to actually find a score or school in there.

Question:

Is there an application, preferably with a database that would store/archive scores, that would have a backend for entering the data and the front end would put the in nice format-able table cells? A search feature would be great as well.

Does this sound like an existing script or application we could use or does it sound more like a custom job?

Worst case scenario - I stay up all night Friday nights for the next 10 weeks hand coding these %$#$@ scores into tables! :)

Thanks for any thoughts or suggestions.

Daf
 
Considering the sheer size of the PHP/MySQL community I should think there may be something similar to what you want.

Try Google.

What you want to do doesn't seem that complex. Why not write your own script?

Gathering info from a form, storing it in a database table and then retrieving data and outputting HTML is probably one of the most basic things you can do with PHP.

If you are inexperienced in this, then read a tutorial (Google again) and have a go. The Tek-Tips community is great for helping you out with code if you're stuck.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Here's a very rough outline of what you need to do. It's simple and perhaps not the best way, but I hope it will help you understand the process.

Create Database tables.
Code:
Teams - teamid, teamname
Fixtures - fixtureid, date, hometeam, awayteam, hometeamscore, awayteamscore
Hint: In fixtures, you may want to store the team ids rather than the team names.


Then you need an HTML form to fill in fixture info...
Code:
Fields for:
Date
Home team (select box), Home team score
Away team (select box), Away team score
The select boxes can be generated by querying the Teams table.

You may even wish to skip this step and just use a thhird party database admin tool instead.

Once you have some data in your fixtures table you then need a script to query the table and output some HTML with the data inserted.

This would be a simply database query which would depend on exactly how you wanted to do it and which database you were using.

For instance, in MySQL you might use something like:

Code:
SELECT f.fixtureid, f.hometeam, f.hometeamscore, f.awayteam, f.awayteamscore FROM fixtures f ORDER BY DATE DESC

Using PHP you would then loop through the result of your query and output lines of HTML something like
Code:
<?php
foreach($result as $data){
?>
<tr>
<td><?=$data['date'];?></td>
<td><?=$data['hometeam'];?></td>
<td><?=$data['hometeamscore'];></td>
<td> Vs. </td>
<td><?=$data['awayteamscore'];?></td>
<td><?=$data['awayteam'];?></td>
</tr>
<?php
}
?>

Something like that anyway, it won't work 'as is' but should give you a general idea.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Hi,

Thank you very much for the replies! I appreciate the effort, but I couldn't code my way out of a wet paper sack. I'm really going to need an "out of the box" script or service I think.

I was trying to search on google but I don't think mu keywords are on... I'm coming up with more database management tools than frontend/backend solutions. Most seem to be more about backend.

Thanks again!
Daf
 
You jogged my memory.

I did a site for a youth soccer team about 5 years ago.
I would imagine the coding is horrible since I was just starting with PHP/MySQL and not into HTML/CSS in the way I am now.

I found a half working installation
there are some working pages at

and


You can even access the admin from the Kev's Gran page (right side, below the heading).

I can give you the source for this (once I've checked it for confidential info) if you wish. As I said, it's messy.. oh lord I hate looking at old code.

It will start you off though.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Hey, that would be great, provided I could make a go of it. Much appreciated either way.

Thanks again!
Daf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top