About the different "databases"...you should just create additional tables within the Links SQL database that you are using. And you would not really have to use separate copies of search.cgi. Also, you will have to add additional .def files for the other tables. Now in terms of indexing these tables, you will have to add some index codes to the SQL.mysql file and also create the tables via the setup.cgi script.
Just add some parameters and conditional statements in the sub search routine, like the following:
# Now let's search the links table, but first figure out any filters.
if ($in->param('SearchMode') eq 'BibleSearch') {
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Bible.def";
}
if ($in->param('SearchMode') eq 'MusicSearch') {
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Music.def";
}
if ($in->param('SearchMode') eq 'LinksSearch') {
$linkdb = new Links::DBSQL "$LINKS {admin_root_path}/defs/Links.def";
}
Then in your search form codes, add the following radio buttons:
<input type="radio" name="SearchMode" value="BibleSearch"> Bible
<input type="radio" name="SearchMode" value="LinkSearch" CHECKED> Links
<input type="radio" name="SearchMode" value="MusicSearch"> Music
OR a drop-down menu:
<select name="SearchMode" size="1">
<option value="BibleSearch"> Bible</option>
<option value="LinksSearch" SELECTED> Links</option>
<option value="MusicSearch"> Music</option>
</select>
Regards,
Eliot Lee
Just add some parameters and conditional statements in the sub search routine, like the following:
Code:
# Now let's search the links table, but first figure out any filters.
if ($in->param('SearchMode') eq 'BibleSearch') {
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Bible.def";
}
if ($in->param('SearchMode') eq 'MusicSearch') {
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Music.def";
}
if ($in->param('SearchMode') eq 'LinksSearch') {
$linkdb = new Links::DBSQL "$LINKS {admin_root_path}/defs/Links.def";
}
Then in your search form codes, add the following radio buttons:
Code:
<input type="radio" name="SearchMode" value="BibleSearch"> Bible
<input type="radio" name="SearchMode" value="LinkSearch" CHECKED> Links
<input type="radio" name="SearchMode" value="MusicSearch"> Music
OR a drop-down menu:
Code:
<select name="SearchMode" size="1">
<option value="BibleSearch"> Bible</option>
<option value="LinksSearch" SELECTED> Links</option>
<option value="MusicSearch"> Music</option>
</select>
Regards,
Eliot Lee