CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 USING DATABASE TO STORE AND RETRIEVE PAGES

Print topic Send  topic

Author Message
beatrizdvcruz

Posts: 1
Posted: 10/19/2011, 2:35 AM

Hello people,
I have created an application in Code Charge where my site users can login and play games online.The game code is run via flash and html. The Game has 5 stages and from a page in my application called transfertogame.php , i transfer them to the game page. Now i want to be able to track each players progress via database so that when they log back in and they get to the transfertogame.php page, it can check the page they were on before and immediately take them to the page without starting from page 1. Any help will be appreciated as i am very poor with php scripting
This is the session ID i guess is being used from my application page

//Initialize Method @4-537EA73F
function Initialize()
{

if(!$this->Visible)
return;

$this->ds->Parameters["sesUserID"] = CCGetSession("UserID");
}
//End Initialize Method

//Validate Method @4-7E1FC38C
function Validate()
{
$Validation = true;
$Where = "";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate");
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method

_________________
I am here to Learn!!! What about You?
View profile  Send private message
magus

Posts: 98
Posted: 10/22/2011, 6:02 AM

Hello beatrizdvcruz,

What you are describing does not sound difficult too do.

The client is logged in so you have their userid. The transfertogame page just needs event code to query the database for the last game then send a redirect to the client.

If they only progress once a game is completed then the you will need to update the database once the client has completed that game. This would be on the transfertogame page. If they progress whether the complete the game or not, then the transfertogame page can record the transfer when it issues the redirect.

A column in the user table could do for storing the game stage for each user, or if you want to track progress more, a separate table with userid, gamelevel and a timestamp could be used. A sorted timestamp query with limit 1 will give the most recent completed game.

I hope this is some help.
If you don't know about db queries in event code?? Try looking at the documentation:

http://docs.codecharge.com/studio40/html/ProgrammingTec...gleDBValue.html

http://docs.codecharge.com/studio40/html/ProgrammingTec...eCustomSQL.html

The components you have on your transfertogame page will determine which event to use to run the queries.

Good luck,
Don
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.