First of all, check out Kevin's tutorial. That will answer a lot of your questions. Then visit http://www.phpbuilder.com and read some there. That'll get all of your leftover questions.
But here's how to use a SELECT statement to search.
SELECT
all relevant fields separated by commas, required to show results
FROM
the table where the content being searched is
WHERE
here's where you filter the results. Maybe WHERE TITLE LIKE '%$string_to_search%'
;
$result = mysql_query(
"SELECT * FROM news,reviews,interviews,articles WHERE articles.body LIKE '%$term%' AND lps.reviewtext LIKE '%$term%' AND eps.reviewtext LIKE '%$term$' AND singles.reviewtext LIKE '%$term%' AND interviews.body LIKE '%$term%' ");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
exit();
}
while ( $row = mysql_fetch_array($result) ) {
WWWWwwhhhhhhhhhhatgoeshere
}
would this work ? and what would be pushed into the array ?
Bookmarks