PHP Classes

New functionalities

Recommend this page to a friend!

      Oracle wrapper  >  All threads  >  New functionalities  >  (Un) Subscribe thread alerts  
Subject:New functionalities
Summary:I added new functionalities to your class
Messages:2
Author:sinasalek
Date:2007-07-26 06:52:36
Update:2007-07-26 09:39:00
 

  1. New functionalities   Reply   Report abuse  
Picture of sinasalek sinasalek - 2007-07-26 06:52:37
Hi,
thanks for this useful class. i extend it with some new
functionalities and i thought it would be a good idea to send it to you.
so other people can benefit from it.

Change Log :
- oracle transaction support :
- _commitMode variable
- startTransaction() method //start a transaction
- commit() method //apply changes to database
- rollback() method //rollback changes within current open transaction
- insert() & update() method
- query stack (keeps the last and all of executed tables)
- _queriesStack variale //contains all of executed sql(s)
- _lastQuery variable //contains the last executed query
- registerQuery() method //add query to queries stack
- getLastQuery() method //get the last executed query

insert & update usage :
$columnsValues=array('name'=>'new name');
$dbc->insert('news',$columnsValues);

$columnsValues=array('name'=>'new name');
$dbc->update('news','id',$columnsValues,'4');

transaction usage :
$dbc->startTransaction();
$columnsValues=array('name'=>'new name');
if (!$dbc->insert('news',$columnsValues)) {
$dbc->rollback();
} else {
$dbc->commit();
}


SOURCE CODE : http://salek.ws/projects/oracle/Oracle.lib.php.txt

  2. Re: New functionalities   Reply   Report abuse  
Picture of Tarmo Protsin Tarmo Protsin - 2007-07-26 09:39:01 - In reply to message 1 from sinasalek
Updated the Oracle class and also the example scripts file according to your changes.

I haven't coded php for years cause switching over to .net and c#. That's why i haven't changed (developed further) the code myself. But as you said, other devs can benefit from it.

Thank you for your input!