hi friends,
im having a problem do i need to create 2 tables or 2 database for this?
i want to create a game where participants need to register before they could guess.
my table structure: (i dont know if its right)
Registration table:
userid(auto), username, fname, lname, password
guess table:
userid(auto), guess1, guess2, guess3, date_entry(auto)
the link for the user and the game is the userid
and i need to create a display(admin) for the game.
sample output:
Name Guess1 guess2 guess3 date entry
james 57 54 49 Apr. 30, 2011
how do i create the sql for the table and the query for linking the 2 tables?
Thank you. hope you could help me.
4 replies to this topic
#1
Posted 24 April 2011 - 08:30 PM
|
|
|
#2
Posted 24 April 2011 - 10:10 PM
any help?
Thank you.
Thank you.
#3
Posted 24 April 2011 - 11:26 PM
SELECT name, guess1, guess2, guess3, date_entry FROM registration r JOIN guess g ON r.userid = g.userid
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#4
Posted 25 April 2011 - 10:05 PM
hi,
how will php know if the 3 numbers entered by the currently login user, know that it is his guess.
how will php know if the 3 numbers entered by the currently login user, know that it is his guess.
#5
Posted 26 April 2011 - 12:24 AM
add a where statement on
WHERE r.userid='$loggedinid'at the end of that statement where $loggedinid is the id of logged in user.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









