Gossamer Forum
Home : Products : DBMan : Customization :

New Database

Quote Reply
New Database
Planning on using DBMAN to make a Fantasy Cricket script. I have a problem with the database structure. There would obviously be two tables to start off with:

Table Name - User

UserName
Password
Email Address
etc, etc

Table Name - Players

Name
Type
Points

The problem is with the Points in the Players table because Users would have different points for the same player so I would obviously need to incoporate Points in another table.

How would I do this though with DBMAN?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------

Last edited by:

Philip_Clark: Oct 17, 2003, 2:49 PM
Quote Reply
Re: [Philip_Clark] New Database In reply to
I would think it would be possible to have them all in the same table, but to make it so certain users can only see so much.

For example, I'm guessing that you have permissions different for players and user. An example:

<table>

|;

if ($per_user) { print qq| <tr><td>UserName:</td><td>$rec{Userid}</td</tr> }

print qq|

|;

if ($per_user) { print qq| <tr><td>Password:</td><td>$rec{password}</td</tr> }

print qq|

|;

if ($per_user) { print qq| <tr><td>Email Address:</td><td>$rec{Email}</td</tr> }

print qq|

|;

if ($per_user) { print qq| <tr><td>etc:</td><td>$rec{etc}</td</tr> }

print qq|

|;

if ($per_player) { print qq| <tr><td>Name:</td><td>$rec{Name}</td</tr> }

print qq|

|;

if ($per_player) { print qq| <tr><td>Type:</td><td>$rec{Type}</td</tr> }

print qq|

|;

if ($per_player) { print qq| <tr><td>Points:</td><td>$rec{Points}</td</tr> }

print qq|

</table>

That way it would only show the correct info for the permissions they have. I have something similar set up on my database and for admins it shows stuff that I wouldn't have a member or default user seeing. Just a thought. :-)
Hope that helps!


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Quote Reply
Re: [shann123] New Database In reply to
Thanks for your response

You've put in the right direction. I'll go away and have a play. I'll post another reply in this thread if I have any questions.

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] New Database In reply to
Got it all in one table now. These are the fields:

Name
EmailAddress
Location
Team Name

Bat1
Bat1Points

Bat2
Bat2Points

Bat3
Bat3Points

Bat4
Bat4Points

WK
WKPoints

AR1
AR1Points

AR2
AR2Points

Bowl1
Bowl1Points

Bowl2
Bowl2Points

Bowl3
Bowl3Points

Bowl4
Bowl4Points

Each field would be a drop down menu with a list of players you can pick. Admin would need an easy way of updating the points and not having to do it user by user.

For example - If John/James/Philip all picked Matthew Hayden as a player we'd need a quick way of assigning the points to Matthew Hayden and not having to go into each users account manually.

How could I do this? Hope it makes sense!

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------

Last edited by:

Philip_Clark: Oct 18, 2003, 4:40 PM
Quote Reply
Re: [Philip_Clark] New Database In reply to
I don't know if it would be the easiest or not, but I would probably use the Modify Multiple Records mod at http://www.jpdeni.com/dbman/mods.html

With that installed, you should be able to search by selecting the name of the player in your select field and it would bring up all the records that had picked that player. Then you could modify all of them at the same time.

There's probably something better, but I don't know what it'd be. I'm still really new to cgi, but thanks to jpdeni and LoisC, I'm learning a lot. Sly


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Quote Reply
Re: [shann123] New Database In reply to
Thanks for that - haven't looked at DBMAN in years so can't remember a lot Blush

With the players drop down menus is it possible to have an Add form for what to show in the drop down menus rather than specifying what's in them via the .cfg file?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] New Database In reply to
Quote:
With the players drop down menus is it possible to have an Add form for what to show in the drop down menus rather than specifying what's in them via the .cfg file?


Not that I know of, but I could be wrong. Hopefully someone will jump in on that and let ya know for sure. :-)


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Quote Reply
Re: [shann123] New Database In reply to
I still think your best bet would be to go with the relational mod.

I know yours is different due to having users entering different stats for each player than what I did with an Ice Hockey script, but it would be similar in other ways.

check out: http://hammer.prohosting.com/lauction/hockey.shtml

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] New Database In reply to
Any chance of giving me a user account so I can have a look around and a look at your coding for that database?

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------
Quote Reply
Re: [Philip_Clark] New Database In reply to
Sorry, but I don't allow anyone access to my files.

The databases are setup as relational and uses one for the players and one for the stats. Yours would be different as you want each user to be able to enter stats for the various players, if I understand you correctly.

I believe by downloading JPDeni's example relational database it will provide you with the setup necessary to get you started.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] New Database In reply to
Finished up writing it all in PHP Cool

Check it out here http://www.cricketweb.net/...asycricket/index.php

Feel free to signup and join in on the fun Cool

---------------
Cricket Web - http://www.cricketweb.net
Cricket Web Forum - http://forum.cricketweb.net/
---------------