Hello all,
I have finally worked thru some php code to get my website search to work.
The only problem I have now (you may find more), is that when I receive the results from my query, the table is not formatted correctly,
Here is the link to my page, and if you search for "Adast" (Which is the first listing under my first column named "Press Model") then all four of the results are returned side by side in the table.
Link: www.myfiberweb.com/press_sizing_chart.html
I hope I have explained this so it makes sense. 😕
php code:
<?php
$id = "%".$_GET["search"]."%";
$sid = $_GET["search"];
$user = "*****";
$password = "*****";
$database = "*****";
mysql_connect("*****", $user, $password);
@mysql_select_db($database) or die("Unable to select database!");
$data = mysql_query("SELECT * FROM dampener WHERE Press_Model Like '$id'");
if(empty($sid))
{
echo'<h1>Oooops! You forgot to enter the press model. </H1>';
echo'<p><a href="http://www.myfiberweb.com/press_sizing_chart.html">Back to Search Page </a></p>';
exit();
}
elseif($data)
{
echo "<font size = '4'>";
echo "<font color = 'blue'>";
echo "<center>:::: Fiberweb - Dampener Cross Reference Chart ::::</font>";
echo "<br><br><br>";
echo '<table border="1">';
echo '<tr>';
echo'<th>Press Model</th>';
echo'<th>Roller Diameter </th>';
echo'<th>Red 1 Size Form </th>';
echo'<th>Red 1 Ductor </th>';
echo'<th>Red 1 Cut Form </th>';
echo'<th>Red 1 Cut Ductor </th>';
echo'<th>Red 1 Set </th>';
echo'<th>Hyton Press </th>';
echo'<th>Hyton Cut Form </th>';
echo'<th>Hyton Cut Ductor </th>';
echo'<th>Hyton Cut Set </th>';
echo'<th>Red Runner </th>';
echo'<th>Classic Loop Form </th>';
echo'<th>Classic Loop Ductor </th>';
echo '<tr>';
echo'</tr>';
while($info = mysql_fetch_array( $data ))
{
Print "<td><b><center><font size = '3'>".$info['Press_Model'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Roller_Diameter'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Red_1_Size_Form'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Red_1_Ductor'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Red_1_Cut_Form'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Red_1_Cut_Ductor'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Red_1_Set'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Hyton_Press'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Hyton_Cut_Form'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Hyton_Cut_Ductor'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Hyton_Cut_Set'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Red_Runner'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Classic_Loop_Form'] . "</td> ";
Print "<td><b><center><font size='3'>".$info['Classic_Loop_Ductor'] . "</td> ";
}
exit();
}
?>