 |
|
 |
|
- Readme First! - Read and follow the rules, otherwise your posts will be closed |
|
|
|
|
|
There are currently, 177 guest(s) and 0 member(s) that are online.
You are Anonymous user. You can register for free by clicking here |
|
|
|
|
|
Fighting againt Windmills - Bug in block-User_Info.php |
|
Laffer writes "From Version 6.5 I am reporting from a wrong coding in block-User_Info.php which results in Slow queries, because of '%' Signs the Query can not use the Index.
Here again the FIX:
Locate this Area:
//Creating SQL parameter
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
and change to:
//StartModification ----------
//Modification to USE the INDEX 30-OCT-2003
//byOliverRatzeburg-webmaster@comicfan.de
//Creating SQL parameter
if (strlen($mday) == 1) { $mday = "0".$mday; };
$curDate2 = $month[0].$month[1].$month[2]." ".$mday.", ".$year;
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
if (strlen($preday) == 1) { $preday = "0".$preday; };
$curDateP = $premonth[0].$premonth[1].$premonth[2]." ".$preday.", ".$preyear;
//EndofModification
Result: NO MORE SLOW QUERIES...."
|
|
Posted on Saturday, November 01 @ 16:26:37 CET by Zhen-Xjell |
|
|
|
|
| |
|
| The comments are owned by the poster. We aren't responsible for their content. |
| | | | |
No Comments Allowed for Anonymous, please register | | | | |
Re: Fighting againt Windmills - Bug in block-User_Info.php (Score: 1) by Jeruvy on Sunday, November 02 @ 10:02:11 CET (User Info | Send a Message) | Nice, very clean solution and minimal code impact. |
| | | | | |
|