[ic] Database transaction?

T. Stoffels tstoffels at gmail.com
Tue May 31 11:28:19 EDT 2005

I just was pointed towards a different, imho more simple  approach:
I just do the begin..query..query..commit/rollback stuff myself =)
[tmp mysqlresult_begin][query sql=|begin work|][/query][/tmp]
[tmp mysqlresult_del1][query sql=|delete ...|][/query][/tmp]
[tmp mysqlresult_del2][query sql=|delete ...|][/query][/tmp]

			[if type=explicit compare=" 
				$Scratch->{mysqlresult_begin} == 1 && 
				$Scratch->{mysqlresult_del1} == 1 && 
				$Scratch->{mysqlresult_del2} == 1  
				[query sql=|commit|][/query]
				everything deleted

			      [else]do rollbackhere [/else]

But I just noticed that the query.../query tag does *not* return 1 if
the query was successfull or 0 if the database returned an error, as I
though before.

It seems to be the number of rows affected.

So I'd need to know how I can tell whether an sql statement caused an
error or was processed succesfully - even if it didnt affect any rows
(like 'begin' for example).

Once more thx in advance...

More information about the interchange-users mailing list