My code is pasted below for those not that dont want to dload it :-P
<html>
<head>
<title>Our Contacts</title>
<style type="text/css">
body
{
background-color: #3366CC;
}
a:link
{
color: #000000;
}
a:visited
{
color: #00FF00;
}
a:hover
{
color: #0000FF;
}
a:active
{
color: #0033FF;
}
</style>
</head>
<body>
<?
//call in library holding all my functions
include 'function_lib.php';
//Connect to the server
$dbh=mysql_connect ("localhost", "username", "password")
or die ('I cannot connect to the database because: ' . mysql_error());
//Select the db I want to use
mysql_select_db ("database");
$TrName = $_POST["TName"];
$TrArea = $_POST["TArea"];
$SkName = $_POST["SName"];
?>
<table width="100%" border="1">
<tr>
<td rowspan="3">Links Panel</td>
<td>Trainer Name:</td>
<td><input type="text" name="TName" maxlength="30"></td>
<td><form action = "SearchTrainerName($TrName);" method="post"><input type="button" value="Search Trainer Names"></form></td>
</tr>
<tr>
<td>Trainer Area:</td>
<td><input type="text" name="TArea" maxlength="30"></td>
<td><form action = "SearchTrainerArea($TrArea);" method="post"><input type="button" value="Search Trainer Areas"></form></td>
</tr>
<tr>
<td>Skill Name:</td>
<td><input type="text" name="SName" maxlength="30"></td>
<td><form action = "SearchSkillName($SkName);" method="post"><input type="button" value="Search For Skills"></form></td>
</tr>
</table>
</body>
</html>
<?
function SearchTrainerName($TrName)
{
$TrNameResults = mysql_query("select * from Trainers where TrName = \"$TrName\"
/*
and (
(TrSk1 is not null) or
(TrSk2 is not null) or
(TrSk3 is not null) or
(TrSk4 is not null) or
(TrSk5 is not null) or
(TrSk6 is not null) or
(TrSk7 is not null) or
(TrSk8 is not null) or
(TrSk9 is not null) or
(TrSk10 is not null) or
(TrSk11 is not null) or
(TrSk12 is not null) or
(TrSk13 is not null) or
(TrSk14 is not null) or
(TrSk15 is not null) or
(TrSk16 is not null) or
(TrSk17 is not null) or
(TrSk18 is not null) or
(TrSk19 is not null) or
(TrSk20 is not null)
)*/");
echo("<hr>");
}
function SearchTrainerArea($TrArea)
{
$TrAreaResults = mysql_query("select * from Trainers where TrArea = \"$TrArea\"
/*
and (
(TrSk1 is not null) or
(TrSk2 is not null) or
(TrSk3 is not null) or
(TrSk4 is not null) or
(TrSk5 is not null) or
(TrSk6 is not null) or
(TrSk7 is not null) or
(TrSk8 is not null) or
(TrSk9 is not null) or
(TrSk10 is not null) or
(TrSk11 is not null) or
(TrSk12 is not null) or
(TrSk13 is not null) or
(TrSk14 is not null) or
(TrSk15 is not null) or
(TrSk16 is not null) or
(TrSk17 is not null) or
(TrSk18 is not null) or
(TrSk19 is not null) or
(TrSk20 is not null)
)*/");
echo("<hr>");
DisplayTRAreaResults($TrAreaResults);
}
function SearchSkillName($SkName)
{
$TrSkillResults = mysql_query("select * from Trainers where \"$SkName\"
/*
and (
(TrSk1 is not null) or
(TrSk2 is not null) or
(TrSk3 is not null) or
(TrSk4 is not null) or
(TrSk5 is not null) or
(TrSk6 is not null) or
(TrSk7 is not null) or
(TrSk8 is not null) or
(TrSk9 is not null) or
(TrSk10 is not null) or
(TrSk11 is not null) or
(TrSk12 is not null) or
(TrSk13 is not null) or
(TrSk14 is not null) or
(TrSk15 is not null) or
(TrSk16 is not null) or
(TrSk17 is not null) or
(TrSk18 is not null) or
(TrSk19 is not null) or
(TrSk20 is not null)
)*/");
echo("<hr>");
}
function DisplayTRAreaResults($TrAreaResults)
{
$rowsFound = mysql_num_rows($TrAreaResults);
echo("<table>");
echo("<tr>");
echo("<th>TrainerID</th>");
echo("<th>Trainer Name</th>");
echo("<th>Directions to Trainer</th>");
echo("<th>Trainer Area</th>");
echo("<th>Trainer Skill 1</th>");
echo("<th>Trainer Skill 2</th>");
echo("<th>Trainer Skill 3</th>");
echo("<th>Trainer Skill 4</th>");
echo("<th>Trainer Skill 5</th>");
echo("<th>Trainer Skill 6</th>");
echo("<th>Trainer Skill 7</th>");
echo("<th>Trainer Skill 8</th>");
echo("<th>Trainer Skill 9</th>");
echo("<th>Trainer Skill 10</th>");
echo("<th>Trainer Skill 11</th>");
echo("<th>Trainer Skill 12</th>");
echo("<th>Trainer Skill 13</th>");
echo("<th>Trainer Skill 14</th>");
echo("<th>Trainer Skill 15</th>");
echo("<th>Trainer Skill 16</th>");
echo("<th>Trainer Skill 17</th>");
echo("<th>Trainer Skill 18</th>");
echo("<th>Trainer Skill 19</th>");
echo("<th>Trainer Skill 20</th>");
echo("</tr>");
while( $row = mysql_fetch_array($TrAreaResults) )
{
echo("td" . $row[TrID] . "</td>");
echo("td" . $row[TrName] . "</td>");
echo("td" . $row[TrDir] . "</td>");
echo("td" . $row[TrArea] . "</td>");
echo("td" . $row[TrSk1] . "</td>");
echo("td" . $row[TrSk2] . "</td>");
echo("td" . $row[TrSk3] . "</td>");
echo("td" . $row[TrSk4] . "</td>");
echo("td" . $row[TrSk5] . "</td>");
echo("td" . $row[TrSk6] . "</td>");
echo("td" . $row[TrSk7] . "</td>");
echo("td" . $row[Trsk7] . "</td>");
echo("td" . $row[TrSk8] . "</td>");
echo("td" . $row[TrSk9] . "</td>");
echo("td" . $row[TrSk10] . "</td>");
echo("td" . $row[TrSk11] . "</td>");
echo("td" . $row[TrSk12] . "</td>");
echo("td" . $row[TrSk13] . "</td>");
echo("td" . $row[TrSk14] . "</td>");
echo("td" . $row[TrSk15] . "</td>");
echo("td" . $row[TrSk16] . "</td>");
echo("td" . $row[TrSk17] . "</td>");
echo("td" . $row[TrSk18] . "</td>");
echo("td" . $row[TrSk19] . "</td>");
echo("td" . $row[TrSk20] . "</td>");
echo("</tr>");
}
echo("</table>");
echo("<p>$rowsFound records match your criteria</p>");
}
/*
function DisplayTRSkillResults($TrSkillResults)
{
}
function DisplayTRNameResults($TrNameResults)
{
}
*/
?>