Need help with MSSQL Transactions

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ecorriel
Forum Newbie
Posts: 1
Joined: Fri Jul 25, 2003 12:49 pm

Need help with MSSQL Transactions

Post 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?
drfunk
Forum Newbie
Posts: 2
Joined: Sat Apr 02, 2005 4:31 pm

Hi

Post 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
Post Reply