Author Topic: website database help  (Read 309 times)

Offline moose

  • Gold Member
  • *****
  • Posts: 2702
      • http://www.ccrhl.com
website database help
« on: September 13, 2005, 01:13:20 AM »
Hey,
I'm trying to accomplish something and im not sure the way to go about it. If those in the know could steer me in the right direction I would be greatly appreciative!

I run a hockey league and I would like the statistics for each player to be dynamic. The roster pages would somehow link to a single database which kept individual player records that i could either edit with a web based form or just edit by hand.. This way I could integrate season to season tracking for each player without having to update each players page manually. (not an option with 32 players)

What kind of programming would this be in? I know its possible, and I'm willing to get the books and sit down and learn..
« Last Edit: September 13, 2005, 01:16:26 AM by moose »
<----ASSASSINS---->

Offline beet1e

  • Persona Non Grata
  • Platinum Member
  • ******
  • Posts: 7848
website database help
« Reply #1 on: September 13, 2005, 03:43:19 AM »
Hi Moose!

Not sure exactly what you want, but perhaps Microsoft Access 2003 would be a good start. I think as database managers go, it would be at the lightweight end. Then there's the more heavy duty Microsoft SQL Server.  I've got a big thick book about Access that you could have, but the postage might come to more than it's worth.

Good luck, and let us know what you decide.

Offline forHIM

  • Gold Member
  • *****
  • Posts: 2534
website database help
« Reply #2 on: September 13, 2005, 06:09:13 AM »
The most common Web site DB & programming language is MySQL with PHP.  The PHP code would be the "front-end" -- it would do your queries and display your dynamic data.  The MySQL db could be edited by hand or using a set of PHP scripts or some other language.

Depending on how detailed you want to go and how much time you have, there are a number of programs that build the PHP / DB structures for you or you can hand-code it.  

I'd check to see what your ISP / web site hosting company supports -- If they have the phpMysqlAdmin interface, then setting up the database and hand editing should be a breeze.  After that, using one of the PHP table building scripts should get you up and running.

Offline moose

  • Gold Member
  • *****
  • Posts: 2702
      • http://www.ccrhl.com
website database help
« Reply #3 on: September 13, 2005, 02:58:46 PM »
allright, i figured it would be something along the lines of MySQL.. i have a little bit of experience with that from an old job, gonna go to the bookstore and see what they have on reference guides now
<----ASSASSINS---->

Offline Clifra Jones

  • Silver Member
  • ****
  • Posts: 1210
website database help
« Reply #4 on: September 13, 2005, 03:27:53 PM »
Quote
Originally posted by moose
allright, i figured it would be something along the lines of MySQL.. i have a little bit of experience with that from an old job, gonna go to the bookstore and see what they have on reference guides now


Well, there are a few questions that need to be answered.

1. What OS is your hosting service using, Unix/Linux or Windows?
2. Does your hosting service support MYSQL/PHP application?

Another way is to use XML files. They are a lot lighter than an SQL database and easier to maintain and troubleshoot as the XML files are just text file. Both Windows and Linux have extensive support for XML. I use XML a lot now for applications that I used to use SQL for. Unless you have a large amount of data to store XML is a better way to approach this kind of application.

Offline indy007

  • Gold Member
  • *****
  • Posts: 3294
website database help
« Reply #5 on: September 13, 2005, 03:55:37 PM »
MySQL/PHP is easy & your best bet. Barnes & Knowbles has some good, cheap books that are incredibly useful references for it. iirc, they have purple & yellow covers and are $10.

When all else fails... google it.

Offline moose

  • Gold Member
  • *****
  • Posts: 2702
      • http://www.ccrhl.com
website database help
« Reply #6 on: September 14, 2005, 10:08:59 AM »
well, i found a module for phpmywebsite that does most of what i want.. unfortunately, support for showing statistic league leaders is not in yet.. the developer says 'add it if you want' but thats way beyond my scope i think

here is what i've got sofar.. http://www.103rd.net/ccrhl/ .. just in testing phase. never played with php before so im trying to get the rss feed to go where i want and stuff.. blah
<----ASSASSINS---->

Offline indy007

  • Gold Member
  • *****
  • Posts: 3294
website database help
« Reply #7 on: September 14, 2005, 11:04:00 AM »
Quick way to display stats, sorted by leaders:

Add a drop down box in html with the options you want to sort by.

On the form submit, have it call the stat display file into the target frame.
explanation for form handling here

In the php file to display the sorted stats, change the sql query from:
get * from whatever
into
get * from whatever order by $_POST['sortchoice']

...or however the records & form are setup.

explanation for ORDER BY here

Can't remember if you have to delcare $_POST['variables'] in the beginning of the php or not, but that should get you going in the right direction. It's alot easier than you think it is :)
« Last Edit: September 14, 2005, 11:12:00 AM by indy007 »

Offline moose

  • Gold Member
  • *****
  • Posts: 2702
      • http://www.ccrhl.com
website database help
« Reply #8 on: September 14, 2005, 11:26:02 AM »
i was actually looking through those pages last night.. ill get crackin on this now :)

i screwed something up while playing around and now im getting ?'s before most of my links.. duno how that happened, maybe its in the css or something?

edit: btw thanks for the assistance. i've always been good with html but when it comes to anything involving programming i get confused easily
<----ASSASSINS---->

Offline moose

  • Gold Member
  • *****
  • Posts: 2702
      • http://www.ccrhl.com
website database help
« Reply #9 on: September 14, 2005, 11:34:00 AM »
hmm, already confused.. the leaguewebsite doesnt have a function for just displaying player statistics as its own page.. you can browse by team and it shows you that way,but there's no way to just have a 'league leaders' point of view

im sure theres a way maybe by calling and sorting the data from all 4 teams?
<----ASSASSINS---->

Offline indy007

  • Gold Member
  • *****
  • Posts: 3294
website database help
« Reply #10 on: September 14, 2005, 11:56:10 AM »
Quote
Originally posted by moose
hmm, already confused.. the leaguewebsite doesnt have a function for just displaying player statistics as its own page.. you can browse by team and it shows you that way,but there's no way to just have a 'league leaders' point of view

im sure theres a way maybe by calling and sorting the data from all 4 teams?


the ? after the address is how php passes variables through url's.

Just make a php file. You can copy-paste over most of the code from the one that displays the teams. Add in a form with a drop-down menu to select what you want to sort by, and a submit button at the top of it. When they select the option and hit submit, the php page can call itself back into the target frame. That form should have various options like Hit Perc, HR, Bases Hit, etc. In the php file you use $sortby = $_POST['nameofthesortform'] to grab the form's selected option and assign it for use.

Then query would be something along the lines of:

$query = "select * from team1,team2,team3 ORDER BY ";
$query .= $sortby;

You can then simply add an html link on the main menu loading that php file into the target frame, just like the current links that displays team standings & such.

Sorry if it's not that clear... I went from not writing any code at all since highschool to having to write a several thousand line site in the last few months.. I confuse myself regularly. :huh
« Last Edit: September 14, 2005, 11:58:12 AM by indy007 »