CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Help converting custom code from CC to Studio

Print topic Send  topic

Author Message
TonyE
Posted: 08/23/2002, 7:48 AM

I am recreating an application in Studio that I had created in CC. I have a piece of custom code in CC that I do not know, on how to convert into Studio.
It is a modified code from the credit card interface on the CC bookstore application. When pushing the submit button on the billing information form all the items in the shopping cart table are copied into the purchase table including the auto increment field (info_id) from the billing information table.

This custom code was placed in the after insert event


$infoID = mysql_insert_id();
//append the value to the sParams variable. This should be done only if the record form has transfer input parameters

$sParams .= "&info_id=".$infoID;
// If there are no transfer input parameters, append the value to the sActionFileName variable

//You can also set a session variable to contain the value
session_register("infoID");

$db->query("insert into purchases (info_id, item_id, company_id, user_id, quantity) select $infoID, item_id, company_id, user_id, quantity from orders where company_id=".get_session("CompID"));

$db->query("delete from orders where company_id=".get_session("CompID"));

Does anyone know on how convert this in Studio? Or at least is able to point me in the right direction.

TonyE
Nicole
Posted: 08/24/2002, 2:44 AM

Tony,
you should create after insert event again and use code like below:

$infoID = mysql_insert_id();
global $Redirect;
$Redirect .= "info_id=". $infoID;
CCSetSession("infoID", $infoID);
$conn = new clsDBconnection_name;
$conn->query("insert into purchases (info_id, item_id, company_id, user_id, quantity) select $infoID, item_id, company_id, user_id, quantity from orders where company_id=".CCGetSession("CompID"));
$conn->query("delete from orders where company_id=". CCGetSession("CompID"));

TonyE
Posted: 08/24/2002, 7:00 AM

Nicole it tried it, and it works like a champ!

Thank you, Thank you, Thank you

Tony Elmiger

   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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