Page 1 of 1

Need help with MSSQL Transactions

Posted: Fri Jul 25, 2003 12:49 pm
by ecorriel
help. i would like to know whether a transaction is successful or not, what should i do? right now i have something like this:

********************TSQL******************
declare @success int
BEGIN TRAN
...
...
...
IF (@@ERROR<>0) BEGIN
set success=1
COMMIT TRAN
END

select @success as success
*****************************************
$res=mssql_query([that_whole_thing],$db_link)
************************************************
it runs fine when i run it on MSSQL Server but running it from php using mssql_query will execute the transaction, but not the select clause.

mssql_fetch_object($res) returns nothing, same with
mssql_fetch_array($res).

anyone have any ideas?

Hi

Posted: Sat Apr 02, 2005 4:34 pm
by drfunk
Did you ever figure out this problem of yours? I have the same problem. I need to run BEGIN TRANSACTION, ABORT, COMMIT on several queries but seem to have problems where the transactions are not working. MSSQL returns me an error to my php page when I send it a COMMIT query.

Thanks,
Ly