Revision: 1328
http://mrbs.svn.sourceforge.net/mrbs/?rev=1328&view=rev
Author: cimorrison
Date: 2010-04-15 15:12:44 +0000 (Thu, 15 Apr 2010)
Log Message:
-----------
Added a "LIMIT 1" to an SQL query to improve performance
Modified Paths:
--------------
mrbs/trunk/web/auth_db.inc
Modified: mrbs/trunk/web/auth_db.inc
===================================================================
--- mrbs/trunk/web/auth_db.inc 2010-04-15 15:09:13 UTC (rev 1327)
+++ mrbs/trunk/web/auth_db.inc 2010-04-15 15:12:44 UTC (rev 1328)
@@ -42,7 +42,7 @@
// which is safe.
$pass = md5($pass);
- return max(0, sql_query1("select count(*) from $tbl_users where name='$user'
and password='$pass';"));
+ return max(0, sql_query1("SELECT COUNT(*) FROM $tbl_users WHERE name='$user'
AND password='$pass' LIMIT 1"));
// The max is used to cover the case when there's an SQL Query error (ie
-1), probably because $tbl_users
// hasn't been set up yet. In that case we want to return 0 (ie validation
failed)
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits