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