Pulling the trigger is the easy way out....
Ok -- my fields/rows
num (auto_incriment) primary key
title
url
description
keywords
location
channel
email
date_entered (timestamp)
WHEN I type something into my searchbar, regardless of what row, I'd like those entries with this word to be displayed. In the end, what WILL be displayed should be:
Title name (hyperlinked with URL) and the description. This will be your typical "portal search" result page. The keywords are to be searched, but not displayed.
Currently my code is:
<?php
mysql_connect("localhost","abcde","12345678") or die("Unable to connect");
@mysql_select_db("my_db") or die("Unable to select database");
$result = mysql_query("SELECT * FROM my_table");
$matchcount =0;
while ($row = mysql_fetch_row($result)) {
$pattern=$searchterm;
if(preg_match("/$pattern/i", $row[6])) {
echo "$row[1], $row[2], $row[3], $row[4], $row[5]";
$matchcount++;
}
}
if($matchcount == 0) { echo "No matches"; }
?>
When I go through the search bar, regardless what I put in, I get "No matches" -- if I simple type in the URL of the .php file (that holds this code), it displays all the records in a big cluster.
Hammering cocked back....
Guido