Skip to Content.
Sympa Menu

freetds - [freetds] transactions using freetds and php

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ben Vogan <benvogan AT hotmail.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] transactions using freetds and php
  • Date: Thu, 24 Jun 2010 10:57:56 -0600


Hi all,
This might be more of a PHP question that freetds but I thought I would try
my luck here. I was wondering what the proper way to use transactions from
PHP talking to SQL Server 2008. I tried:
mssql_query('BEGIN TRANSACTION');try { loop { //multiple inserts here }
mssql_query('COMMIT TRANSACTION');} catch (Exception $ex) {
mssql_query('ROLLBACK TRANSACTION');}
However I get errors that there was no begin transaction. Is this pattern
possible in PHP or do I have to concatenate all my sql into one query (which
would be very unfortunate)?
Thanks for your help,--Ben
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969



Archive powered by MHonArc 2.6.24.

Top of Page