Book now with code EOY2025
<center> <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td width="60">[b]Manufacturer[/b]</td> <td width="100">[b]Colour[/b]</td> <td width="70">[b]Texture[/b]</td> <td width="70">[b]Manufacturing Process[/b]</td> </tr> <tr> <td> <? $hostname = "l"; // The Thinkhost DB server. $username = "t"; // The username you created for this database. $password = "t; // The password you created for the username. $usertable = "t"; // The name of the table you made. $dbName = "tt"; // This is the name of the database you made. MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable"); @mysql_select_db( "$dbName") or die( "Unable to select database"); ?> <? $XX = "No Record Found, to search again please close this window"; $query ="SELECT * FROM bricks WHERE"; if ($Manufacturer != "SelectManufacturer") //The Default select value { switch ($Manufacturer) { case Manufacturer1: "SELECT * FROM mytable WHERE Manufacturer='Manufacturer1'"; case Manufacturer2: "SELECT * FROM mytable WHERE Manufacturer='Manufacturer2'"; break; case Manufacturer3: "SELECT * FROM mytable WHERE Manufacturer='Manufacturer3'"; break; } } ?> $variable1=$row["Manufacturer"]; $variable2=$row["Colour"]; $variable3=$row["Texture"]; $variable4=$row["Manufacturing Process"]; print ("<tr>"); print ("<td>$variable1</td>"); print ("<td>$variable2</td>"); print ("<td>$variable3</td>"); print ("<td>$variable4</td>"); print ("</tr>"); } if (!$variable1) { print ("$XX"); } ?>
TechJunky wrote: why not use DHTML to accomplish this?
MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable"); @mysql_select_db( "$dbName") or die( "Unable to select database"); function secured($val) { $val = strip_tags(trim(($val))) ; $val = escapeshellcmd($val); return stripslashes($val); } if (get_magic_quotes_gpc()) { $Manufacturer = $_POST['Manufacturer']; } else { $Manufacturer = addslashes($_POST['Manufacturer']); } secured($Manufacturer); if ($Manufacturer != "SelectManufacturer") { $query = "SELECT * FROM bricks WHERE Manufacturer=".$Manufacturer; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if(!$num_rows) { echo "<table><tr><td align='center'>No data found 0 record returned</td></tr></table>"; } else { echo "<table align='center'><tr>"; echo "<td align='center'>[b]Manufacturer[/b]</td>"; echo "<td align='center'>[b]Colour[/b]</td>"; echo "<td align='center'>[b]Texture[/b]</td>"; echo "<td align='center'>[b]Manufacturing Process[/b]</td>"; echo "</tr>"; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) echo "<tr><td align='center'>".$row["Manufacturer"]."</td>"; echo "<td align='center'>".$row["Colour"]."</td>"; echo "<td align='center'>".$row["Texture"]."</td>"; echo "<td align='center'>".$row["Manufacturing Process"]."</td>"; echo "</tr>"; } echo "</table>"; } ?>
$query = "SELECT * FROM bricks WHERE Manufacturer=".$Manufacturer; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if(!$num_rows) { echo "<table><tr><td align='center'>No data found 0 record returned</td></tr></table>";
Use code EOY2025 to receive $250 off your 2025 certification boot camp!