Pages: [1]
Author Topic: Finding inactive games with search function  (Read 833 times)
Customers
Full Member
*

Karma: 1
Posts: 31


on: Dec 05, 08, 01:33 PM

Hi there,

Maybe someone has a sollution for this. When I use the search function it also find inactive games. So when people click on the one of the games in the searchresults which is inactive it sees an error.

ProArcadeScript DB ERROR!
Query failed.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1 - 1064.
QUERY: SELECT id, title, latin_title FROM categories WHERE id= LIMIT 1


Any help would be appreciated.

Regards,
Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #1 on: Dec 06, 08, 08:35 AM

try to edit the query string in the "search.php" file (near 60th line) by adding
Code:
AND active=1
right before "WHERE".
Logged
Customers
Full Member
*

Karma: 1
Posts: 31


Reply #2 on: Dec 06, 08, 11:39 AM

I tried, but maybe I am doing something wrong. I changed the code to this:

}
$searchstr = mysql_escape_string($_REQUEST['searchstr']);
$query = "SELECT * FROM " . $cMain['dbPrefix'] . "games AND active=1 WHERE title LIKE '%$searchstr%' OR MATCH(description) AGAINST ('$searchstr') OR keywords LIKE '%$searchstr%' LIMIT ".$cB["SEARCH"]["max"];
$arGames = $db->super_query( $query, true );
if( count($arGames) > 0 )
{


But getting the following error for all my search queries now.

ProArcadeScript DB ERROR!
Query failed.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND active=1WHERE title LIKE '%sewer%' OR MATCH(description) AGAINST ('sewer') O' at line 1 - 1064.
QUERY: SELECT * FROM games AND active=1WHERE title LIKE '%sewer%' OR MATCH(description) AGAINST ('sewer') OR keywords LIKE '%sewer%' LIMIT 20


Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #3 on: Dec 07, 08, 01:29 AM

sorry, "AND active=1" must be right before LIMIT, not WHERE
« Last Edit: Dec 07, 08, 01:39 AM by Sergey » Logged
Customers
Full Member
*

Karma: 1
Posts: 31


Reply #4 on: Dec 07, 08, 02:23 AM

Thanks! It works.. Grin
Logged
Pages: [1]
 
Jump to: