Ask a Question related to Coldfusion Database Access, Design and Development.
-
Matt McSpirit #1
Access Database update using a link
Hi guys,
Im pretty new to CF, but im learning fast yet ive become a litte unstuck with
this problem.
Im producing a small web based database system that contains employee
information, travel details etc, and im currently working on the employee
administration section (adding new employees, editing etc).
The code is working well up to now, and i have built a page that retrieves
data from the database, and fills a table, i.e. Name, Phone number, etc, and
this works fine. (note, this is not a form for submission, it is purely a table
to view the details of that employee)
At the bottom of the table, i wish to have 4 links, Edit Employee, Demote from
Manager, Send Message, Delete Employee.
It is the 'Demote From Manager' Link that i am having trouble with.
Basically, this text is dynamic, i.e. If the Employee who'se details are on
screen is actually a manager, the link will say "Demote from Manager", however,
if the employee is not a manager, the link will say "Make a Manager".
The code is as follows:
<cfif IsManager IS 'Yes'>
Demote from Manager
<cfelse>
Make a Manager
</cfif>
This section works fine. However, what i want to happen is, when the
adminisrator clicks "Demote/Make Manager", i want that to be instantly
reflected in the database.
I thought about having a link that passed a URL parameter to a processing page
that did the update, before re-directing using cflocation but im just unsure
how it would be accomplished.
Any help would be great,
Thanks,
Matt
Matt McSpirit Guest
-
Showing the email link from a database link
Hi Does anyone know how to have an email link show when showing the databse info in a repeating table. Here is the link... -
Access Database will not update
I've got CF7 running on WinXP SP2 with Access 2000 database. Very simple table - 4 fields, all text except the Key. I can view, I can Insert, but... -
How to let Shockwave link to database?
I want to use database in Shockwave3D. Is there interface in Lingo? Or is there any instead way? -
Help needed with ASP form browse for file, create link to file and insert in access database
I have a form where a user enters their name, date etc. i also want them to be able to click on a browse button and select a file which will then... -
Link to an external folder AND UPDATE
I need to create a project with a link to an external folder and a script which reads the folder on startmovie to save all the filenames included in... -
ben #2
Re: Access Database update using a link
Either put the function in a form with a submit button
or use a link with URL, such as:
<cfif IsManager IS 'Yes'>
<a href="http://actionpage.cfm?action=demote">Demote from Manager</a>
<cfelse>
<a href="http://actionpage.cfm?action=promote">Make a Manager</a>
</cfif>
On the action page, look for
#URL.action#
which will be either "demote" or "promote", then update your db accordingly.
Matt McSpirit wrote:> Hi guys,
>
> Im pretty new to CF, but im learning fast yet ive become a litte unstuck with
> this problem.
>
> Im producing a small web based database system that contains employee
> information, travel details etc, and im currently working on the employee
> administration section (adding new employees, editing etc).
>
> The code is working well up to now, and i have built a page that retrieves
> data from the database, and fills a table, i.e. Name, Phone number, etc, and
> this works fine. (note, this is not a form for submission, it is purely a table
> to view the details of that employee)
>
> At the bottom of the table, i wish to have 4 links, Edit Employee, Demote from
> Manager, Send Message, Delete Employee.
>
> It is the 'Demote From Manager' Link that i am having trouble with.
> Basically, this text is dynamic, i.e. If the Employee who'se details are on
> screen is actually a manager, the link will say "Demote from Manager", however,
> if the employee is not a manager, the link will say "Make a Manager".
>
> The code is as follows:
>
> <cfif IsManager IS 'Yes'>
> Demote from Manager
> <cfelse>
> Make a Manager
> </cfif>
>
> This section works fine. However, what i want to happen is, when the
> adminisrator clicks "Demote/Make Manager", i want that to be instantly
> reflected in the database.
>
> I thought about having a link that passed a URL parameter to a processing page
> that did the update, before re-directing using cflocation but im just unsure
> how it would be accomplished.
>
> Any help would be great,
>
> Thanks,
>
> Matt
>
>ben Guest
-
Matt McSpirit #3
Re: Access Database update using a link
Excellent, thanks for that, its working perfectly.
Cheers,
Matt
Matt McSpirit Guest



Reply With Quote

