Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 PHP Extension Manual » Connection Functions » edb_starttrans |
edb_starttrans(<ConnectionHandle> [, <TableNames>]) <ConnectionHandle> = Handle of connection returned by edb_connect function <TableNames> = A single table name (STRING), or an array of table names for multiple tables
TRUE if successful, or FALSE if there are any errors
<?php // The following script connects to an ElevateDB // Server and database, starts a transaction on // the Customer and Orders tables using the // edb_starttrans() function, inserts a row // into each table, commits the transaction // using the edb_commit() function, and then // disconnects using the edb_disconnect() function $con = edb_connect("type=remote;charset=Ansi;address=127.0.0.1;"+ "uid=Administrator;pwd=EDBDefault;database=Test"); if (!$con) { die("Could not connect: " . edb_errmsg()); } edb_starttrans($con,array("Customer","Orders")); echo edb_intrans($con); $custcmd = edb_prepare($con,"customer",EDB_COMMAND_TABLE); $custcursor = edb_execute($custcmd); $ordcmd = edb_prepare($con,"orders",EDB_COMMAND_TABLE); $ordcursor = edb_execute($ordcmd); edb_insert($custcursor); edb_setcol($custcursor,"CustNo",1000); edb_setcol($custcursor,"Company","Test Company"); if (!edb_post($custcursor)) { $msg = edb_errmsg(); edb_rollback($con); die("Error adding customer: " . $msg); } edb_insert($ordcursor); edb_setcol($ordcursor,"CustNo",1000); edb_setcol($ordcursor,"OrderNo",100); edb_setcol($ordcursor,"SaleDate","2010-02-24"); edb_setcol($ordcursor,"EmpNo",10); if (!edb_post($ordcursor)) { $msg = edb_errmsg(); edb_rollback($con); die("Error adding order: " . $msg); } edb_commit($con); edb_disconnect($con); ?>
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |