Make search search in app keywords and not only in app name

This commit is contained in:
Jonathan Ernst
2005-01-30 22:20:55 +00:00
committed by WineHQ
parent 29f5bddee3
commit b95ccd52da

View File

@@ -7,18 +7,20 @@
* application environment * application environment
*/ */
include("path.php"); include("path.php");
require(BASE."include/"."incl.php"); require(BASE."include/incl.php");
require(BASE."include/"."application.php"); require(BASE."include/application.php");
$search = str_replace("'", "\\'", $_REQUEST['q']); $sQuery = "SELECT *
$search = "%$search%"; FROM appFamily
WHERE appName != 'NONAME'
$query = "SELECT * FROM appFamily WHERE appName != 'NONAME' AND appName LIKE '$search' ORDER BY appName"; AND appName LIKE '%".addslashes($_REQUEST['q'])."%'
$result = query_appdb($query); OR keywords LIKE '%".addslashes($_REQUEST['q'])."%'
ORDER BY appName";
$hResult = query_appdb($sQuery);
apidb_header("Search Results"); apidb_header("Search Results");
if(mysql_num_rows($result) == 0) if(mysql_num_rows($hResult) == 0)
{ {
// do something // do something
echo html_frame_start("","98%"); echo html_frame_start("","98%");
@@ -38,7 +40,7 @@ else
echo "</tr>\n\n"; echo "</tr>\n\n";
$c = 0; $c = 0;
while($ob = mysql_fetch_object($result)) while($ob = mysql_fetch_object($hResult))
{ {
//skip if a NONAME //skip if a NONAME
if ($ob->appName == "NONAME") { continue; } if ($ob->appName == "NONAME") { continue; }
@@ -68,5 +70,4 @@ else
} }
apidb_footer(); apidb_footer();
?> ?>