Not too sure what you mean when you say 'php form'. I'm going to assume you mean an HTML form with some PHP. I might be wrong (I am occasionally. Well, rarely 😉 ).
if ($_POST['submit'] != "Go Go Database Search Monkey!") {
echo "<form action=\"".basename($PHP_SELF)."\" method=\"POST\">";
echo "Find: <input type=\"text\" name=\"term\">";
echo "<input type=\"submit\" name=\"submit\" value=\"Go Go Database Search Monkey!\">";
echo "</form>";
} else {
$sql = "select * from myTable where name='".$_POST['term']."'";
$result = mysql_query($sql,$databaseLink);
if (mysql_num_rows($result) > 0) {
$record = mysql_fetch_object($result);
echo $record->name;
}
}
Obviously the database connection stuff is missing there, and you wouldn't have "Go Go Database Search Monkey!" in a proper application, but thats the basics covered.
And I haven't tested that.