From: Hendrik <nh...@us...> - 2009-06-01 17:10:20
|
Update of /cvsroot/arianne/stendhal_website/scripts In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3579/scripts Modified Files: npcs.php Log Message: implemented getNPCs which returns a list of NPCs Index: npcs.php =================================================================== RCS file: /cvsroot/arianne/stendhal_website/scripts/npcs.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** npcs.php 1 Jun 2009 17:07:54 -0000 1.2 --- npcs.php 1 Jun 2009 17:10:11 -0000 1.3 *************** *** 57,60 **** --- 57,61 ---- } + /** * gets the names NPC from the database. *************** *** 65,68 **** --- 66,79 ---- } + + /** + * Returns a list of npcs that meet the given condition. + * Note: Parmaters must be sql escaped. + */ + function getNPCs($where='', $sortby='name', $cond='') { + return _getNPCs('select * from npcs '.$where.' order by '.$sortby.' '.$cond, getGameDB()); + } + + private function _getNPCs($query) { $result = mysql_query($query,getGameDB()); |