I have an SQL Database set and have a small website that read datfrom it uses ColdFusion.
What I need to do is have a value submitted via a form and the data in the new pages opens up with reference only to the value submitted from the form. (????)
<option value = "Doulgas">Douglas</option>
<option value = "Rileys">Rileys</option>
<option value = "Railway">Railway</option>
<option value = "OldeMIll">Olde Mill</option>
<option value = "The Vault">The Vault</option>
<option value = "Michelin">Michelin</option>
<option value = "Fairmuir">Fairmuir</option>
<option value = "NorthEnd">North End</option>
<option value = "Whitfield">Whitfield</option>
<option value = "Newport">Newport</option>
<option value = "Tivoli">Tivoli</option>
<option value = "DD1">DD1</option>
</select>
This is the CF Query on the page "teamdetails.cfm" that will display the data. I want to only dispaly the data that matches the request from the previous page.
<CFQUERY NAME = "info" datasource = "sql_0603051">
SELECT name,clubadd,clubph,captain,captainph,vice,vicepn,notes
WHERE "teamselectedfrompreviousepage" teams.name
FROM teams
</CFQUERY>
any suggestions?
I would also like the window to open up in a new window with no menus etc
You Are Missing the name of the form, the form element, & the query is wrong
You Are Missing The Name Of Your Form, and you are missing the name of your Form element, the Form itself shouldn't have a VALUE attribute, and the Output of the query is wrong too. Major coding issues.
<option value = "Doulgas">Douglas</option>
<option value = "Rileys">Rileys</option>
<option value = "Railway">Railway</option>
<option value = "OldeMIll">Olde Mill</option>
<option value = "The Vault">The Vault</option>
<option value = "Michelin">Michelin</option>
<option value = "Fairmuir">Fairmuir</option>
<option value = "NorthEnd">North End</option>
<option value = "Whitfield">Whitfield</option>
<option value = "Newport">Newport</option>
<option value = "Tivoli">Tivoli</option>
<option value = "DD1">DD1</option>
</select>
On the other page. It is not wise to abbreviate all the field names of your table. Don't be lazy, do the right thing and spell them out completely like "CaptainPhone" or "captain_phone" not captainph. It's way too ambiguous. Lastly, you MUST change the field "name" to something like "TeamName" or "team_name", because if you look at the code for the first page it will say Name="name". That can cause serious issues, so here below I'm doing it for you.
<CFQUERY NAME = "info" datasource = "sql_0603051">
SELECT teamName,clubadd,clubph,captain,captainph,vice,vicepn,notes
FROM teams
WHERE teamName = "#Form.TeamName#
</CFQUERY>
Bookmarks