I think I see. I've done similar.  Heres how I handled it: Each course that
could be updateable had its fields ending with _#i# at the end.  i is just a
counter.   So, the first course had course_id_1, the second, had
course_id_2.  So the user makes his changes and submits, on the server side,
you now have form vars that end with _i.  So, you loop thru your update with
a while statment, the condition for the while statment is the existence of
the form var course_id_i, and you access your vars like form['course_id_' &
i].


Does this make sense?  I can fill in a bit if you need.

DRE

-----Original Message-----
From: mayo [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 9:14 AM
To: CF-Talk
Subject: RE: list, adding to

I have an admin screen which will (hopefully) allow users to be able to
update a class schedule.

The update query will often have to update several records, so the query
will be looped.

I have two different submit buttons.

Top of the screen has

Class Title [textbox]
Class Description [textarea]
etc...
[submit button]

Bottom of the screen deals with date/time

Class Date [dropdowns for month,day,year]
Class Start [dropdown]
Class End [dropdown]

A hidden field has the record ID

I would like the user to be able to do multiple updates with one submit,
example change the time start from 6PM to 6:30PM and the end time from 8PM
to 8:30PM.

This is further complicated as there are often numerous sessions.

So "Beginning Guitar" can have

session one: 4 consecutive Mondays from 6:30-8:30
session two 4 conseuctive Tuesdays from 7:00-9:00

etc...

there are up to 6 sessions.

I would like the users to be able to update as many sessions (time, day) as
necessary, press "submit" and then loop through the records when processing
the submit.

thx,

Gil

-----Original Message-----
From: Andre Turrettini [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 10:53 AM
To: CF-Talk
Subject: RE: list, adding to

  A list is not a special datatype, its just a simple string.  There happen
to
  be some functions that operate on strings assuming certain delimiters but
  its still just a string.

  However, it looks like youre sticking dates into the IN parameter of your
  query which wont work.  So, this is a sql problem not a list problem.  Can
  you try and explain a bit more?

  DRE

  -----Original Message-----
  From: Gyrus [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 16, 2003 8:38 AM
  To: CF-Talk
  Subject: RE: list, adding to

  At 00:58 16/10/2003 -0400, you wrote:
  >I would like the user to be able to update at whim and to loop through
  these
  >records and update them.

  Sorry, I can't quite grasp what you're trying to do, or what the form
  does... Is this an admin system for course organisers to change the dates
  of courses?

  >When I get to the update section I should be able to put the IDs in a
list
  >and then from that list get a LISTLEN
  >
  >and do a
  >
  ><cfloop list="#dateList#" index="dateSessions">
  >
  >       <cfquery name="getSessionDays" datasource="">
  >
  >        UPDATE classDates
  >        SET
  >         classDay='#FORM.classDay#',
  >         classSession='#FORM.classSession#',
  >         classDates='#dateSessions#',
  >         classStart='#FORM.classStart#',
  >         classEnd='#FORM.classEnd#'
  >
  >        WHERE ID IN(#dateList#)
  >
  >    </cfloop>

  What error do you get?

  Gyrus
  [EMAIL PROTECTED]
   http://norlonto.net/gyrus/dev/ <http://norlonto.net/gyrus/dev/>
<http://norlonto.net/gyrus/dev/>
  PGP key available

    _____

  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to