/    Sign up×
Community /Pin to ProfileBookmark

storing user’s score

hi, say i have a few forms (html/php), the first form takes the user’s name and the other forms ask the user questions. what i would like to do is take the user input and store their name and score in a database (mysql).

i was wondering if anyone knows of any tutorial / open-source code to do this (or something similar)?

thanks.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@cbVisionFeb 21.2012 — Here's something to get you started:

http://www.w3schools.com/php/php_mysql_intro.asp
Copy linkTweet thisAlerts:
@NoEffinWayFeb 21.2012 — [code=php]$points = 5;//or whatever the question is worth.
$oldscore = mysql_query("SELECT score FROM table WHERE username='$username'");
$newscore = $points+$oldscore;
$addscore = mysql_query("UPDATE table SET score = '$newscore' WHERE usernsme='$username'");[/code]
Copy linkTweet thisAlerts:
@eval_BadCode_Feb 21.2012 — You might consider limesurvey. It is a "box" solution, basically you follow the "install", make the survey. Test it, customise how it looks, then you're done. It comes with a admin-panel, so it's like of like the PHPMyAdmin of surveys. It supports so many kinds of surveys that it's insane, I'm sure there's one that will associate points with the questions/answers.

Don't waste your time making a survey script from scratch. I learned that the hard way.
×

Success!

Help @mv0010 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...