Re: Database creation advice request.

www.scoreattack.net

Database creation advice request.


tabitha 02-20-2006, 2:48 AM

What I would like to do is something like this.

1 - have a table for each player containing scores for each level which I can update as new scores arrive.

2 - Display the results for these tables per dream more or less the same as they are now on the page.

3 - Have 1 additional page with something like total scores/average scores etc for each player.

Also I want to do this in the simplest possible way which doesnt involve editing pages and pages of HTML all the time.

I have done a little reading on ASP/Excel and PHP/mySQL and while both of these appear to do the job I am not sure if there is an easier way. Anyone have any ideas?

Re: Database creation advice request.


EVL 02-20-2006, 2:13 PM
First of all, don't have one table for each player. A number of reasons for this - it would be a pain to maintain, it would get messy if the site gets busy, and most importantly it would be a nightmare to write sql to pull the data out.

Probably the simplest way to do it would be to have one score table, one column for the player, and one column for each of the scores. There are better ways to do this, but they'd involve more complex sql.

As far as what to use goes, don't try using something like excel - it's not really designed for this sort of thing. I don't know what your web hosting company offers, but PHP/mySQL would do the job.

By the way, there would be no editing pages of HTML necessary once it's done.

Re: Database creation advice request.


tabitha 02-20-2006, 8:01 PM
So basically one massive table with I think, *does a quick bit of maths*

7 drams with 4 mares = 24
7 total dream scores
7 bosses
I will worry about xmas nights later

so a table with columns and 1 row for each player then quesry the table using php?

If thats the way forward I will get on it. My hosting company has mySQL on the server via a slightly wierd graphical interface called phpadmin I belive.

Thanks for the advice.

Re: Database creation advice request.


EVL 02-21-2006, 3:16 AM
If you wanted to put each dream in a table of it's own, that wouldn't hurt, and would possibly make things slightly more manageable.

If you do do this though, create a master table for the players, one column for the player name, and one with an id (mySQL would provide an autoincrement field which would probably be the way to go). Then in each of the score tables, rather than storing the player name against the scores, you store the id. This would reduce a few possibilities for error, and allow you to add more specific data about a player if you wanted to in the future (for example tying their id on the scoreboard to their id on the forum).

Re: Database creation advice request.


tabitha 02-23-2006, 11:00 AM
Well, im going with the big database with all the score in it with the user id being the unique field just to get things rolling for the moment. I have the table created at last and entering all the scores is just legwork. The way it is set up does seem to make updating an absolute snap which is good.

I have some test data that I am now going to try to interrogate/query with. This is probably going to be the point were I break down and start throwing stuff out of fustration.

Who knows, I might even get to play the game sometime soon!

Re: Database creation advice request.


EVL 02-24-2006, 2:57 AM
If you want me to write a couple of PHP pages to pull data out, I'd be more than happy to.

Fair enough if you don't want - there would be a certain sense of satisfaction with figuring this all out on your own, but just say if you want a hand.

Re: Database creation advice request.


tabitha 02-24-2006, 5:43 AM
Thats most appreciated but I am going to fumble about with it for a bit longer first. The thing which I havent gotten around to thinking about yet is how to integrate the php with the existing tables. That I might need a pointer or two on.

Also, what sort of information do we want from the database? I mean one reason I am doing this is to make updating 20 odd scores a 5 minute breeze instead of a 30 minute royal pain in the butt. However one of the features I really loved about versusmode was that it also gave you a total boss time, a total dream total and a total mare total which was very handy to see how you were faring against other people on the site as a whole. I was thinking of something along these lines as well as a function to look at scores for just one player and another to give an average boss time/dream total/mare total as well as a further page for site records.

While Im still doing this via baby steps it might be handt to know if people have any ideas?

Re: Database creation advice request.


EVL 02-24-2006, 7:42 AM
Yeah, no problem.

I don't quite see what you mean by the totals, but any aggregations will be simple enough.

Also it wouldn't be too tricky to give yourself a page to update peoples scores - it'd probably be more simple than updating the database directly. But then I guess you've got enough on your plate without having to worry about that at the moment. :p


Re: Database creation advice request.


tabitha 02-28-2006, 11:16 AM
Ok, I have spent a LONG time on this over the past week but things basically came together tonight. This is a kind of beta page for the scores pages but run by the database rather than updated by html.

https://www.scoreattack.net/tabithaboof/misc/test3.php

- edit - just realised that I broke the database, I m unbreaking it now.

Re: Database creation advice request.


EVL 03-01-2006, 3:16 AM
Great stuff tabitha, now you've got that page sorted, the others shouldn't me much of a problem at all. :)

But damn, I've got to put a bit of effort into Spring Valley... (I think that's my least favourite level)

Re: Database creation advice request.


tabitha 03-01-2006, 5:44 AM
Thanks alot EVL seeing as you know what you are talking about I take that as high praise.

I still have a few little wrinkles to iron out but the leg work is now done.

And give spring valley some time i has hidden depths.

Re: Database creation advice request.


tabitha 03-02-2006, 8:14 AM
ok this is my final kink:

https://www.scoreattack.net/tabithaboof/scoresv.php

The database is perfect but when accesing the page is give an error which is related to the security certificate being invalid which I totally dont understand. Anyone have even the vaguest clue what this is about? Its the only thing I need to sort before going live with the php driven site...

Re: Database creation advice request.


EVL 03-03-2006, 3:05 AM
Oh yeah, I meant to ask you about with the link before...

There's no reason that you need to be using SSL, and turning it off would sort that out.

I'm not sure how you turn it off, but it's probably going to be on directory level. Your control panel that the hosting company supplies should probably allow you to do this.

In fact, you probably want to keep the tabithabooth directory for your php experiments, and move the files out to a scoreboard (or whatever) folder, or even in the root folder, and maybe that will sort it out.

I don't really know a lot about SSL, and must admit I am guessing a bit here, but let me know how you get on. :)

Re: Database creation advice request.


EVL 03-03-2006, 12:24 PM
By the way, I'm pretty sure that the certificate rubbish is not going to be because your database is on a secure server (the certificates operate on a different level than the script/database stuff)...

Try copying the scoresv.php (for example) file out of the tabithabooth folder and into the root folder for the site to see if http://www.scoreattack.net/scoresv.php gives you the same problem.

Everything in the tabithabooth folder appears to be behind SSL, so I suspect that there is something that is enabling certificates for that whole folder, though I've no idea how you'd turn that off.


Re: Database creation advice request.


tabitha 03-03-2006, 6:17 PM
Well the problem is, the tabithaboof folder IS my root directory. I dont really understand what is going on but for example

http://www.scoreattack.net/scoresv.html

and

https://www.scoreattack.net/tabithaboof/scoresv.php

Are acctually in the same folder. I think that my host treats the /tabithaboof directory as the route. I have emailed them, we shall see what they have to say.

Edit - Ok, I THINK I have sorted it out. I dont recall WHY I was looking at I was pointing my browser at httpS and
/TABITHABOOF but pointing directly at http://www.scoreattack.net/scoresv.php seems to work just fine. Aside from the fact that the total dreams page isnt working for some reason everything else appears to be ok?

Thanks for the help EVL by the way. I wouldnt have even thought of that without your help.
 Page 1 of 2 (22 items) 1 2 >

Powered by Community Server, by Telligent Systems