From: Hendrik B. <nh...@us...> - 2010-06-05 01:48:16
|
Update of /cvsroot/arianne/stendhal_website/scripts In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv10703/scripts Modified Files: players.php Log Message: new method getCharactersForUsername Index: players.php =================================================================== RCS file: /cvsroot/arianne/stendhal_website/scripts/players.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** players.php 1 Jun 2010 22:06:14 -0000 1.32 --- players.php 5 Jun 2010 01:48:08 -0000 1.33 *************** *** 169,172 **** --- 169,185 ---- } + + /** + * Returns a list of characters owned by this account. + * + * @param string $username + * @return List of Players + */ + function getCharactersForUsername($username) { + return _getPlayers('SELECT character_stats.* FROM character_stats, characters, account ' + .'WHERE account.username=\''.mysql_real_escape_string($username).'\' AND ' + .'characters.player_id=account.id AND character_stats.name=characters.charname'); + } + function _getPlayers($query) { $result = mysql_query($query,getGameDB()); |