Sure.
Here's a simple way to do one:
[tt]
<?php
// assume $fieldname is a radio button from a form
$sql = "SELECT $fieldname FROM library WHERE $fieldname LIKE '%$query%'";
// assume $query is the word/words they searched for
$dbresult = mysql_query("database",$sql) or die("failed query"

;
$intnumrows = mysql_num_rows($dbresult);
for ($i=0; $i<$intnumrows; $i++) {
$cl = mysql_fetch_object($dbresult);
print $cl->$fieldname."<br>";
}
?>
[/tt]
That should work for a rudementary beginning search engine.
Here is one that I wrote about 6 months ago. It is really bad coding, but I think it will work. You can play around with it if you like.
[tt]
<?php
include("lib.inc.php"

; // include the library
if ($query == '') {
common_header($cfgBoardTitle,$cfgBoardStyleSheet);
print "You did not enter a query, go back and enter a query.";
std_button("index.php","Back"

;
common_footer();
} else {
connect();
common_header($cfgBoardTitle,$cfgBoardStyleSheet);
common_header2();
start_table();
mysql_select_db($cfgBoardDatabase);
if ($method == "text"

{
$search = "SELECT * FROM messages WHERE text LIKE '%$query%'";
} else {
$search = "SELECT * FROM threads WHERE username='$query'";
}
$result = mysql_query($search);
$found = 0;
?>
<tr>
<td class=title width=6%>Poster</td><td class=title>Post</td></tr>
<?php
for ($i=0; $i<=mysql_num_rows($result)-1; $i++) {
$threadid = mysql_result($result, $i,"threadid"

;
$forumid = mysql_result($result, $i,"forumid"

;
$title = mysql_result($result, $i,"title"

;
$user = mysql_result($result, $i, "username"

;
$email = mysql_result($result,$i,"email"

;
if ($title == '') {
// do nothing, don't print it
} else {
echo "<tr><td class=search align=center><a href=\"mailto:$email\">$user</a></td><td class=search><a href=\"viewpost.php?threadid=$threadid&forumid=$forumid\">$title</a></td></tr>";
}
$found++;
}
if ($found == 0) {
print "<td class=search align=center colspan=2>Nothing matched your query: <b>$query</b></td></tr>";
} else {
echo "<tr><td colspan=2 class=searchresults>There ", $found > 1 ? "were" : "was", " $found ", $found > 1 ? "matches" : "match" ," for your query: <b>$query</b>.</td></tr>";
}
end_table();
mysql_free_result($result);
std_button("index.php","Back"

;
common_footer();
}
?>
[/tt]
Hope this helps.
-Vic vic cherubini
krs-one@cnunited.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash
====