with my php script, it retrieves customer complaint information from a database and lists them on screen. The information it retrieves are like customer records, about 8 fields in total, such as name, date, error reported etc.
Does anyone know how to show just a few fields or a short description, with a link to open the full description in a new window?
I'd make two PHP pages. The first lists the complaints in the short form that you desire, and the second will display everything. Then, what you will need to do is link to the second page with a query string attached, and this will tell the page which record to show.
Hmm... not really. None on that exact subject. It really shouldn't be that hard, as long as you know how to get the records out of the database. On the first page, you will want to display everything that is in the database, with the exception of the complaint (or perhaps just a few words of the complaint). Then, on the second page, you will want to show all the fields for the one specific complain, including the full text of the complaint.
i've made the first page display a summary of fields, along with a link to a second page, that can display all the fields and information.
Problem is, how do i pass the id of the item the user clicked on from the first page to the second - as in how can i tell the second page what item to retrieve?
echo "Your Complaint ID is: " . $_GET["index"];
should be
echo "Your Complaint ID is: " . $_GET["id"];
as we assigned the GET variable "id" to equal the value of $index.
sorry to bring up another old post, but i don't want to start a new one on the subject, when all the info is above.
Theres two sections to the site, a private section and a global section. In these sections, customer complaints are displayed in tables. In the private secton, the content is specific to the login name, and in the global section, the content is all the complaints from all users.
Using the above code:
$index = $row ["complaintID"];
Then on detailed.php, to retreive and display the complete complaint form:
$result = mysql_query("select * from complaints where complaintnumber = ' $_GET[id]' ")
I've just been told that in the private section, the complaintnumber is unique, but in the public section, there may be more than one of the same complaintnumber.
Using this script works fine for the private section, but when in the public section, it will retreive and display two or more complaints if they have the same id.
by adding into the mysql statement:
AND customerid = $Name
will only then retreive the complaint of the name the user logged in as, therefore defeating the point of having a global complaints section.
I've also tried LIMIT 1, but it only retreives the first one it finds.
i was just this second thinking -
how about a check, that if the id's are the same, then it matches, say the first 10 characters of the description - i think this would work, but not sure how.
Bookmarks