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","r oot","")
or die (mysql_error()) ;
mysql_select_db ("noble",$co nn) 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($ge t_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=\"$_SERV ER[PHP_SELF]\">
<p><strong>Sele ct Brand</strong></p>
<select name\"Sel_id\">
<option value\"\">-- Select One --</option>";
while ($recs = mysql_fetch_arr ay($get_list_re s)){
$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("locatio n:selentry.php" );
exit;
}
$get_master = "SELECT Suit_Brand, Suit_Type, Suit_Colour, Suit_Price, Suit_Descriptio n 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_re s,0,'display_su it'));
$display_block = "<h1>Showin g Record for $display_suit</h1>";
if (mysql_num_rows ($get_master_re s)>0) {
$display_block .= "<p><strong>Inf ormation:</strong></p>
<ul>";
while ($add_info = mysql_fetch_arr ay($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_Descriptio n];
$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.dt d">
<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_Fo rms/NobleForms.css"/>
<title>Shirt Form</title>
</head>
<body>
<?php echo $display_block; ?>
</body>
</html>[/PHP]
Thanks in advance.
1 1379
After the first submit the $_POST array contains a value. After the second submit from the generared form the $POST array does no longer contain that value from the first submit, but only the value from the generated form, i.e. the second submit.
Ronald
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Apple Plexy |
last post by:
tearing my hair out here...,
I am creating a site to show artists work. I have a database and can
retrieve and display a list of artisits, other info, and a related image for
each artist - all drawn from the respective entries on the database. What i
would like to do is then use that record to dynamically generate another
page that would display more detailed information about that one specific
artist that the user clicks on - again...
|
by: surrealtrauma |
last post by:
i have a trouble about that:
i want to ask user to enter the employee data (employee no., name, worked
hour, etc.), but i dont know how to sort the data related to a particular
employee as a group. i want to use a array object in the class but i don't
know how..i am just learning the c++. So i dont know how to use class. in
fact, i have writen like the following:
class employee {
public:
employee();
|
by: John Phelan-Cummings |
last post by:
When I add the name of a new individual in a, bound form, it will not
display that person’s name in a label control of a second unbound form.
I have a scheduling program that I am working on. Included in the
application program is a data “GRID” which I believe was created using
Visual Basic, not standard Access. Its purpose is to display the
results of a range of “from-to-dates” of registrations for different
clients. The difficulty...
|
by: dasilva109 |
last post by:
Hi guys
I am new to C++ and need urgent help with this part of my code for a
uni coursework I have to submit by Thursday
//ClientData.h
#ifndef CLIENTDATA_H
#define CLIENTDATA_H
#include <string>
|
by: keke3905 |
last post by:
I really would appreciate some help on this assignment. I need to make GUI boxes to display the system info such as on Microsoft Office. I have some code but not sure where to go with the rest of it. Help please. I will also include instructions that I was given.. I am working in JGrasp environment with Java.
In order to tuning programs to meet the hardware requirements and provide optimal performance, it is very important to retrieve...
| |
by: zaidalin79 |
last post by:
I have a java class that goes for another week or so, and I am going to fail if I can't figure out this simple program. I can't get anything to compile to at least get a few points... Here are the assignments...
4. CheckPoint: Inventory Program Part 1
• Resource: Java: How to Program
• Due Date: Day 5 forum
• Choose a product that lends itself to an inventory (for example, products at your
workplace, office supplies, music CDs, DVD...
|
by: Benny Ng |
last post by:
Dear All,
Now I met one problem in the development of my one application.
I have one ASP.NET page. It's for disply the information of customer.
But now I have one new requirement. It's to combine the "Edit" and "Display"
funtions into this page.
(It means if user want to edit the customer information, this page would
provided editing page to the user;
If the user want to display the customer information, this page would
providev the...
|
by: meyzhong |
last post by:
Hi,
I am new to Visual C++ (6.0). I want to put all the print information
in different lines into a box.
I create a EDIT dialogue box, and then add a CString variable (m_MSG)
to the dialogue box to display the print information in the box.
However, the print information displayed in the box is in one line,
like this "10.0| 20.0". The "\n" character for the change to a new
line has not been recognized.
|
by: =?Utf-8?B?QmVu?= |
last post by:
Hi all,
I am trying to write a test console app in vb2008 express. Below is the
code:
Module Module1
Sub Main()
Dim frm As New Form1
MsgBox("a test message")
'frm.Visible = True
|
by: zion4ever |
last post by:
Hello good people,
Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet reservation of available resources (laptops, beamers, etc). The MySql database queries are already in place, as is the ASP administration panel. The frontend that users will see however, still needs some work. I'm really close, but since I'm no...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |