CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Copy Record to Same Table

Print topic Send  topic

Author Message
maxhugen

Posts: 272
Posted: 10/03/2008, 8:57 PM

I've added a button [Copy] to an Events record page. It's in a panel that hides it, if a new record.

It's purpose is to make a copy of the current record as a new one in the same table `event`.

As a user may have edited the page before clicking Copy, I made the button's operation 'Update'.

The button's OnClick event sets a public flag ( $CopyRequired = 1).

In the AfterUpdate event, if the flag is set, I would like to run an insert query, preferably using CCS functions.

I can see in the event.php page that CCS uses a function InsertRow().

Is there any way that I can get CCS to do an Insert like this somehow?

_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
maxhugen

Posts: 272
Posted: 10/03/2008, 9:10 PM

I should add that I'm trying to avoid running an insert query manually. The `event` table has an auto increment key, so each field has to be individually specified in the insert, in code. Not good from a maintainability perspective, especially since this table is likely to be altered in the future.

Another option might be to build a manual insert query from the form parameters - CCGetQueryString("Form", "") - but the parameters include many that aren't fields, so this could get messy.
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.