Entry
how can I create a search engine to my MySQL database such as the existing in this web site?
Nov 14th, 2002 20:51
Dave, Flavio Cambraia,
The php file where you write your query should have $text (the query) and $in (the field) in it.
Then the result:
$result0 = mysql_query("SELECT data1, data2, data3 FROM table WHERE $in LIKE '%$text%' ORDER BY data1");
while(list($data12, $data22, $data32) = mysql_fetch_row($result0)) {
// listing the data
echo "$data12";
echo "$data22";
echo "$data32";
echo "<hr>";
}