Fighting againt Windmills - Bug in block-User_Info.php
Date: Saturday, November 01 @ 16:26:37 CET
Topic: Bug Fixes


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....





This article comes from NukeCops
http://www.nukecops.com

The URL for this story is:
http://www.nukecops.com/modules.php?name=News&file=article&sid=913