Hello Experts !!!

I have two databases to select from my web page. In this script i can search one database(if ($choice=="staff publication") it works. I dont know how to write the script if I select the other option if($choice=="books"). Please can any one help me. I want to display search resuls of "books" the same way as staff publications. but books database has different fields.

$query="SELECT * FROM books WHERE match (authors, title, callnumber keywords, edition, year, notes) against ('$name' in boolean mode) ORDER BY year DESC";
I want to put the above somewhere in the script and display results.

$link = mysql_connect('localhost', 'root', 'vip');
if (!$link) {
die('Could not connect: ' . mysql_error());

@mysql_select_db(test1) or die("unable to connect");


if ($choice=="staff publications"){

$query="SELECT * FROM staffpub WHERE match (authors, title, source, keywords, mesh, year, notes) against ('$name' in boolean mode) ORDER BY year DESC";


$result=mysql_db_query("test1", $query);
$num_rows = mysql_num_rows($result);
if ($num_rows==0){$search_result="<p class='error'>No Results Found</p>";}
elseif ($num_rows > 0){$search_result="<p class='error'>".$num_rows. " Results Found</p>";}


echo '<b><center><font size="4" color="#FF0000">Search Result</font></center></b><br><br>';

while ($i < $num_rows) {


echo "<b>Authors:</b> $authors<br><b>Title:</b> $title<br><b>Source:</b> $source<br><br><hr><br>";



well you would need to have
somewhere in there to actually use that database

Dear Paradox

I am sorry i made a mistake. it is not two databases. it should be two tables. i will rectify it.