I have used the following code so i could display information from mysql table on to the webpage but when i select a subject from the drop down menu nothing appears can someone please help.
Code
[PHP]<?php
$conn = mysql_connect ("localhost","root","")
or die (mysql_error());
mysql_select_db ("noble",$conn) or die (mysql_error());
if ($_POST[op] != "view") {
$display_block = "<h1>Select Entry</h1>";
$get_list = "SELECT Suit_ID, Suit_Brand as display_suit
FROM suits
ORDER BY suit_brand";
$get_list_res = mysql_query($get_list) or die (mysql_error());
if (mysql_num_rows($get_list_res) < 1) {
$display_block .= "<p><em>No Records</em></p>";
}else{
$display_block .= "
<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">
<p><strong>Select Brand</strong></p>
<select name\"Sel_id\">
<option value\"\">-- Select One --</option>";
while ($recs = mysql_fetch_array($get_list_res)){
$id= $recs ['Suit_ID'];
$display_suit = stripslashes ($recs['display_suit']);
$display_block .= "<option value=\"$id\">
$display_suit</option>";
}
$display_block .= "
</select>
<input type=\"hidden\" name=\"op\" value=\"view\">
<p><input type=\"submit\" name=\"submit\" value=\"View Selected Entry\"></p>
</form>";
}
} else if ($_POST[op] == "view") {
if ($_POST[Sel_ID] =="") {
header("location:selentry.php");
exit;
}
$get_master = "SELECT Suit_Brand, Suit_Type, Suit_Colour, Suit_Price, Suit_Description AS
display_suit
FROM suits
WHERE suit_id = $_POST[sel_id]";
$get_master_res = mysql_query ($get_master);
$display_suit = stripslashes (mysql_result ($get_master_res,0,'display_suit'));
$display_block = "<h1>Showing Record for $display_suit</h1>";
if (mysql_num_rows($get_master_res)>0) {
$display_block .= "<p><strong>Information:</strong></p>
<ul>";
while ($add_info = mysql_fetch_array($get_master_res)){
$Brand = $add_info[Suit_Brand];
$Type = $add_info[Suit_Type];
$Colour = $add_info[Suit_Colour];
$Price = $add_info[Suit_Price];
$Description = $add_info[Suit_Description];
$display_block .= "<li>$Brand $Type $Colour $Price ($Description)";
}
$display_block .= "</ul>";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="Insert_Forms/NobleForms.css"/>
<title>Shirt Form</title>
</head>
<body>
<?php echo $display_block; ?>
</body>
</html>[/PHP]
Thanks in advance.