Hello,
I have this Data into my SQL Table TblDataInfo.
Example of my data:
Data_ID: 10254
user_submitted: 1
user_date_submitted: 2013-01-4 13:10:10.707
User_Confirmation: DATA-16687-20120104011007
id_number: 2432
Data_year: 2011-2012
SELECT [Data_id]
,[user_submitted]
,[user_date_submitted]
,[user_confirmation]
,[id_number]
,[Data_year]
FROM [ABC].[dbo].[tblDATAInfo]
where id_number like '2432'
My Question:
------------------------
<p align="center"><a href="http://www.abc.com"><img src="mybutton.jpg" width="100" height="50" border="0"></a></p>
I would like to add a coldfusion code before the button image so that it disappears from my page, once a user has filed the data. This would involve putting some code around the button "mybutton.jpg" that would check the tblDataInfo table for the member's ID number and the Data_year=2011-2012 (in the same record), which is what gets stored in the table (along with some other info), once the member files.
Now, I have a coldfusion page who display that image button. So I don't want to display the button every time on that page when the user logged again... because he already filled the forms.
So could you please helpm in this , what my new querry should be something like this ?
<cfquery name="DisplayButtons" datasource="ABC" username="#application.username#" password="#application.password#">
SELECT * FROM tblDATAInfo
WHERE (id_number = #client.user_id#) and
(Data_Year = '2011-2012')
</cfquery>
Then my coldfusion code will be:
<cfif .....
<cfif DisplayButtons.recordCount
show the button
</cfif>
(Also, it's a good practice to always use cfqueryparam to prevent sql injection. Edit Not sure of your data types, but something like this: )
Open in new window