I am working on an update form that queries data from a database by the unique identifier. But I am also including another query to a table that lists information on a bunch products we'll call them.
The first query gets the data that matches the unique identifier, the second query hits the second table listing all the products on the update form. On the update form there are CHECKBOXES next to a list of products that are displayed from the second tables query. And if a match is made in the first table (Persons personal info) it will display a checkbox checked next to the product.
I used to have this update form working fine, but it listed ALL products in static fashion. If I ever wanted to make an update to all the products I would have to do so manually in each page they are listed hence why I made a table that has them all for easy maintenance.
Anyway..
My problem is NOW ALL THE DATA is being cycled on the page over and over..
(IE: Lists a HTML TABLE with the update form with name, address, etc etc, then another table with name, address, etc etc etc., then again, and again..)
HOW DO I GET IT TO JUST SHOW THE DATA IN ONE UPDATE FORM WITH OUT IT LOOPING OVER AND OVER?!
I have included the QUERY CODE in the box below. "People" is the table with the users personal info and associated product. "SIMS" is the table with all the products.
Thanks for your help!
(CFQUERY name="people" datasource="STRS"
Select people.*, SIMS.sim2, SIMS.company
from people, sims
WHERE people.PID = #URL.pid#
(/CFQUERY)
The first query gets the data that matches the unique identifier, the second query hits the second table listing all the products on the update form. On the update form there are CHECKBOXES next to a list of products that are displayed from the second tables query. And if a match is made in the first table (Persons personal info) it will display a checkbox checked next to the product.
I used to have this update form working fine, but it listed ALL products in static fashion. If I ever wanted to make an update to all the products I would have to do so manually in each page they are listed hence why I made a table that has them all for easy maintenance.
Anyway..
My problem is NOW ALL THE DATA is being cycled on the page over and over..
(IE: Lists a HTML TABLE with the update form with name, address, etc etc, then another table with name, address, etc etc etc., then again, and again..)
HOW DO I GET IT TO JUST SHOW THE DATA IN ONE UPDATE FORM WITH OUT IT LOOPING OVER AND OVER?!
I have included the QUERY CODE in the box below. "People" is the table with the users personal info and associated product. "SIMS" is the table with all the products.
Thanks for your help!
(CFQUERY name="people" datasource="STRS"
Select people.*, SIMS.sim2, SIMS.company
from people, sims
WHERE people.PID = #URL.pid#
(/CFQUERY)