lanceox Posted April 5, 2011 Share Posted April 5, 2011 Hey everyone A little advice would be great. okay... I have a system that registers users and then allows them to take part in a quiz, which uses sessions and a database however what the problem is, is that i would like the user to be able to see the results of there quiz rather than destroying a session on logout.php for example when they login, they will click member area for example and this will display info about the quiz they completed.... i.e. Scores How would i do keep this info so its not lost on logging out?? Thanks in advance guys Lance Quote Link to comment https://forums.phpfreaks.com/topic/232796-hi-guys-a-little-advice/ Share on other sites More sharing options...
dawsba Posted April 6, 2011 Share Posted April 6, 2011 you have a database already!?! why not store it in there!? Quote Link to comment https://forums.phpfreaks.com/topic/232796-hi-guys-a-little-advice/#findComment-1197532 Share on other sites More sharing options...
lanceox Posted April 6, 2011 Author Share Posted April 6, 2011 yea i have a db but im not too good with them. Havn't really used them much. How would i go about storing the users score in the DB so it can be retrieved? Quote Link to comment https://forums.phpfreaks.com/topic/232796-hi-guys-a-little-advice/#findComment-1197734 Share on other sites More sharing options...
spiderwell Posted April 6, 2011 Share Posted April 6, 2011 the same way you store their details when they first register! Quote Link to comment https://forums.phpfreaks.com/topic/232796-hi-guys-a-little-advice/#findComment-1197737 Share on other sites More sharing options...
lanceox Posted April 6, 2011 Author Share Posted April 6, 2011 ahhh okay, however rather than storing this information through a text field I would like to do it so the user can click save button on the final page and the quiz information is stored onto the database. How could i do this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/232796-hi-guys-a-little-advice/#findComment-1197743 Share on other sites More sharing options...
dawsba Posted April 6, 2011 Share Posted April 6, 2011 if you hold the scores in an array, cheat - use serialize and unserialize $dbdata = serialize($scorearray); $dbinject = mysql_query("INSERT INTO `tbl_dataheldhere` (`id`,`userid`,`date`,`data`)VALUES('','$userid',NOW(),'$dbdata')"); Quote Link to comment https://forums.phpfreaks.com/topic/232796-hi-guys-a-little-advice/#findComment-1197802 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.