View Single Post
  #1 (permalink)  
Old 02-04-2007, 03:28 AM
observer_24_7's Avatar
observer_24_7 observer_24_7 is offline
Pligg Donor
 
Join Date: May 2006
Posts: 45
Thanks: 5
Thanked 3 Times in 2 Posts
Arrow bug in the code. not directly in the feature.

Not sure if this is a bug. But looks like an issue with the code.

In libs/search.php ,

the code is:


if(isset($this->orderBy)){
$this->orderBy = "ORDER BY " . $this->orderBy;
}

When I call it like this .. the this->sql gets multiple ORDER BY in it .. for eg " .... ORDER BY ORDER BY link_vote" ...

So I modified the code to :


if(isset($this->orderBy) && (strstr($this->orderBy, 'ORDER') === false)){
$this->orderBy = "ORDER BY " . $this->orderBy;
}

and it works fine now.

You guys will know best but I think theres a possibility that this->orderBy variable is set multiple times and we get multiple ORDER BY additions to the sql string.



The code I used:

include_once(mnminclude.'search.php');
global $new_search;
$search=new Search();
$search->filterToStatus = 'all';
$search->orderBy = " link_votes ";
$search->doSearch();
$new_search = $search->new_search();
require_once("libs/link_summary.php");
__________________
India Digg : News from users
Reply With Quote