FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » FUDforum 3.0+ » Only one search result is returned.
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Only one search result is returned. [message #30152] Tue, 07 February 2006 08:18 Go to next message
stoph is currently offline  stoph   Germany
Messages: 7
Registered: February 2006
Karma: 0
Junior Member
Ah, sorry, wrong board. Please move it to bugs Smile

I am using version 2.7.4.
If i do a search only one sesult is returned.

It does its job if i change the lines from 147 in /src/search.php.t
to the following:
	$search_data = '{TEMPLATE: no_search_results}';
	$page_pager = '';
} else {
	$i = 0;
	$search_data = '';

	$tmp = array();

	while ( $r = db_rowobj($c))
	{
		$tmp[] = $r;
	}

	foreach ( $tmp as $r) {
		$search_data .= '{TEMPLATE: search_entry}';
	}

	unset($c);


Die Search results are prefetched into the $tmp array and postet within a foreach loop. The previous code ...

	while ( $r = db_rowobj($c))
		$search_data .= '{TEMPLATE: search_entry}';
	}

	unset($c);


... got me only one sesult.

[Updated on: Tue, 07 February 2006 08:22]

Report message to a moderator

Re: Only one search result is returned. [message #30158 is a reply to message #30152] Wed, 08 February 2006 00:53 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Works here fine without any changes. The changes themselves don't appear to make any sense.

FUDforum Core Developer
Re: Only one search result is returned. [message #30161 is a reply to message #30158] Wed, 08 February 2006 10:09 Go to previous messageGo to next message
stoph is currently offline  stoph   Germany
Messages: 7
Registered: February 2006
Karma: 0
Junior Member
Yes i know that Smile the only difference is that the data is fetched outside the original while loop. I did some debugging with this.

I don't know which weird php installation we have but the line
$r = mysql_fetch_object ($c)

is executed only once.

Our hoster uses Apache/1.3.31 and PHP Version 4.4.0 with ZendOptimizer.

This is the SystemConfig
PHP built On:  	Linux titanium 2.6.10-as7-he.piii.4gb #1 SMP Thu Jun 2 10:12:05 CEST 2005 i686
Database Version: 	4.0.24_Debian-4.dotdeb.0-log
PHP Version: 	4.4.0
Web Server: 	Apache/1.3.31 (Unix) FrontPage/5.0.2.2635 PHP/4.4.0
WebServer to PHP interface: 	apache
WebServer User/Group: 	99 / 99
Forum Version: 	2.7.4
Relavent PHP Settings: 	
Safe Mode: 	OFF
Open basedir: 	/tmp:/bin:/usr:[..deleted..]
Display Errors: 	OFF
File Uploads: 	ON
Maximum File Upload Size: 	8M
Magic Quotes: 	OFF
Register Globals: 	OFF
Output Buffering: 	Yes
Disabled Functions: 	none
PSpell Support: 	Yes
Zlib Support: 	Yes
Re: Only one search result is returned. [message #30164 is a reply to message #30152] Wed, 08 February 2006 20:28 Go to previous messageGo to next message
stoph is currently offline  stoph   Germany
Messages: 7
Registered: February 2006
Karma: 0
Junior Member
Another interesting thing is, that i have the same problem with pdf and rdf generation. After changing the while loops to "Read-In-Temp-First"-Mode everything works.

Perhaps it's a strange php 4.4.0 error.
Re: Only one search result is returned. [message #30167 is a reply to message #30164] Wed, 08 February 2006 23:28 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Try to disable the Zend Optimizer, it may be the cause of the problem.

FUDforum Core Developer
Re: Only one search result is returned. [message #31731 is a reply to message #30167] Mon, 15 May 2006 22:54 Go to previous messageGo to next message
damien is currently offline  damien   Canada
Messages: 3
Registered: May 2006
Karma: 0
Junior Member
I hit this problem too, and it was due to the mysql_unbuffered_query() function. When I branched uq() to q(), all was back to normal.

Now, what I don't get is that usage of unbuffered_queries seems to be configurable, yet 'Use MySQL 4.1 Performance Options: ' is set to no.... Is there anything else to configure?
Re: Only one search result is returned. [message #31734 is a reply to message #31731] Tue, 16 May 2006 00:48 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Unbuffered query use is not controlled by configuration options. When deemed safe they are used and in all other places buffered queries are utilized.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: fudforum2.6 + index.php was not found on this server
Next Topic: HTML and FUDcode together?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Jun 17 03:25:53 GMT 2024

Total time taken to generate the page: 0.02621 seconds