list.php: This page retrieves the list of available games, in textual format, with information divided by a separator character. It's up to the developer to split the resulting strings. If you access the page from a browser you can see the list in an html table.
insert.php: Allows to insert, update or keep alive a game in the server. It gets the game name and the player name as parameters. The IP of the host is kept in the database therefore calling this page when you already have a game results in updating it.
delete.php: Deletes a game from the server
config.php: Conrains the data needed to connect to the database
It would be far more efficent to have ONE page, and pass variables with the get method, so say you wanted to insert, go to action.php?i=insert
ip (VARCHAR 255)
name (VARCHAR 255)
player (VARCHAR 255)
last_update (DATETIME)
Will you really have someone whose ip or name are 255 characters? IPv6, the longest version, only has 39 characters. That just increases the server load and memory usages. It would also be more efficient to assign ids to each game to use as a handle, more efficient and easier to manage that using varchars. Try this code to create your table:
create table games(ip varchar(39),name varchar(100), player varchar(20), last_update(DATETIME), id int NOT NULL);
Edited by connor4312, 07 November 2010 - 05:55 AM.











