From: <Kha...@us...> - 2008-09-07 00:33:46
|
Revision: 2154 http://planeshift.svn.sourceforge.net/planeshift/?rev=2154&view=rev Author: Khakilord Date: 2008-09-07 00:33:55 +0000 (Sun, 07 Sep 2008) Log Message: ----------- Removed the first wildcard from queries which were used on big tables that were frequently modified by psserver and npcclient. Modified Paths: -------------- www/webconsole-trunk/npcs/searchnpc.php www/webconsole-trunk/other/view_commands.php www/webconsole-trunk/util.php Modified: www/webconsole-trunk/npcs/searchnpc.php =================================================================== --- www/webconsole-trunk/npcs/searchnpc.php 2008-09-07 00:31:33 UTC (rev 2153) +++ www/webconsole-trunk/npcs/searchnpc.php 2008-09-07 00:33:55 UTC (rev 2154) @@ -26,6 +26,9 @@ } else if ($name!=null and $name!="") { if (strstr($name,"*")) { $name = str_replace("*","%",$name); + if ($name[0] == "%") { + $name = substr($name, 1); + } $query = "select id from characters where name like '$name'"; } else { $query = "select id from characters where name='$name'"; Modified: www/webconsole-trunk/other/view_commands.php =================================================================== --- www/webconsole-trunk/other/view_commands.php 2008-09-07 00:31:33 UTC (rev 2153) +++ www/webconsole-trunk/other/view_commands.php 2008-09-07 00:33:55 UTC (rev 2154) @@ -47,7 +47,7 @@ function whereusedglyph() { - $query_events = "SELECT id,name FROM item_stats WHERE flags LIKE '%GLYPH%' order by name"; + $query_events = "SELECT id,name FROM item_stats WHERE flags LIKE 'GLYPH%' order by name"; $result = mysql_query2($query_events); while ($list = mysql_fetch_array($result, MYSQL_NUM)) { @@ -61,4 +61,4 @@ } -?> \ No newline at end of file +?> Modified: www/webconsole-trunk/util.php =================================================================== --- www/webconsole-trunk/util.php 2008-09-07 00:31:33 UTC (rev 2153) +++ www/webconsole-trunk/util.php 2008-09-07 00:33:55 UTC (rev 2154) @@ -117,7 +117,7 @@ function SelectGlyphs($current_glyphID,$select_name) { printf("<SELECT name=%s>", $select_name); - $query_events = "SELECT id,name FROM item_stats WHERE flags LIKE '%GLYPH%' order by name"; + $query_events = "SELECT id,name FROM item_stats WHERE flags LIKE 'GLYPH%' order by name"; $result = mysql_query2($query_events); while ($list = mysql_fetch_array($result, MYSQL_NUM)){ if ($list[0] == $current_glyphID){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |