1
Newbie
"Could not query the forums database" when searching by author
  • 2004/5/8 20:12

  • Newbie

  • Just popping in

  • Posts: 3

  • Since: 2003/3/13


It says "Could not query the forums database" when you search by any author who is registered in the forums.

Though, this error doesn't occur when you search by any author who is NOT registered to the website.

I am using XOOPS 2.06 and all the rest of the website work fine.

Can anyone help me out?
Thanks.

2
tl
Re: "Could not querry the forums database" when searching by author
  • 2004/5/9 0:28

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


Well, I think you have spotted a bug in XOOPS 2.0.6.

modules/newbb/search.php
Quote:

if ( isset($HTTP_POST_VARS['search_username']) && trim($HTTP_POST_VARS['search_username']) != "" ) {
$search_username = $myts->oopsAddSlashes(trim($HTTP_POST_VARS['search_username']));
if ( !$result = $xoopsDB->query("SELECT uid FROM ".$xoopsDB->prefix("users")." WHERE uname='$search_username'") ) {
redirect_header('search.php',1,_MD_ERROROCCURED);



try change

WHERE uname='$search_username' to

WHERE uname LIKE '%$search_username%'


3
Newbie
Re: "Could not querry the forums database" when searching by author
  • 2004/5/9 8:33

  • Newbie

  • Just popping in

  • Posts: 3

  • Since: 2003/3/13


Thanks for your reply.

But it does not work.

4
Mithrandir
Re: "Could not querry the forums database" when searching by author

Quote:

tl wrote:
Well, I think you have spotted a bug in XOOPS 2.0.6.

The bug is in the newbb module, so I would suggest posting it on the newBB Bug Tracker so it can be fixed for next version.

5
Newbie
submitted to the bug tracker
  • 2004/5/9 16:15

  • Newbie

  • Just popping in

  • Posts: 3

  • Since: 2003/3/13


Quote:
The bug is in the newbb module, so I would suggest posting it on the newBB Bug Tracker so it can be fixed for next version.

Submitted my problem on the Tracker with some more details I forgot to note in my first post.

(BTW I couldn't register to the bug tracker. An error might be happening just in case FYI.)

Thanks!

6
karuna
Re: submitted to the bug tracker
  • 2004/8/3 20:40

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


hi~
Quote:
if ( isset($addquery) ) {
$addquery.=" AND p.uid=$userid AND u.uname='$search_username'";
$subquery.=" AND p.uid=$userid AND u.uname='$search_username'";
} else {
$addquery.=" p.uid=$userid AND u.uname='$search_username'";
$subquery.=" p.uid=$userid AND u.uname='$search_username'";
}

here i changed
if ( isset($addquery) ) to if ( $addquery!="" )

then it works

and the template file newbb_index.html have to change this hidden to submit
Quote:
<input type="hidden" name="submit" value="<{$lang_search}>" />

Login

Who's Online

203 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits