User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 402,450 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,015 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums

Trying to return query results

Join Date: Apr 2006
Posts: 29
Reputation: Stewie is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Stewie Stewie is offline Offline
Light Poster

Trying to return query results

  #1  
Jun 9th, 2006
I have a form set up with 3 select lists where a user can select the date. and from there I insert it into one field in an Access database using this query.
<cfquery name="CheckDate" datasource="Rumors_Forms">
INSERT INTO BusTable (Name, Req_Date, Req_Time, Address, Email, PhoneNumber, Reason)
 Values('#form.Name#', '#form.Month#/#form.Day#/#form.Year#' ,'#form.Req_Time#','#form.Address#','#form.Email#','#form.PhoneNumber#','#form.Reason#')
</cfquery>

it inserts into the DB just fine, what I would like to do, is have all the information output to a form. The thing I am having problems with is getting the date to populate in 3 select lists. here is my code that I have for the select lists.
[html]
<td>Date:</td>
<td><cfparam name="form.month" default=""> <select name="Month">
<cfloop index="month" from =1 to =12 >
<cfif month EQ form.month>
<cfoutput><option value="#month#" selected>#month#</option></cfoutput>
<cfelse>
<cfoutput><option value ="#month#">#month#</option></cfoutput>
</cfif>
</cfloop>
</select>

<cfparam name="form.day" default="">

<select name="Day">
<cfloop index="day" from =1 to =31 >
<cfif day EQ form.day>
<cfoutput><option value="#day#" selected>#day#</option></cfoutput>
<cfelse>
<cfoutput><option value ="#day#">#day#</option></cfoutput>
</cfif>
</cfloop>
</select>

<cfparam name="form.year" default="">

<select name="Year">
<cfloop index="year" from =2006 to =2010 >
<cfif year EQ form.year>
<cfoutput><option value="#year#" selected>#year#</option></cfoutput>
<cfelse>
<cfoutput><option value ="#year#">#year#</option></cfoutput>
</cfif>
</cfloop>
</select></td>
[/html]

Any help would be great.
Thanks
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 3:11 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC