Returns the number of affected rows for the last insert, delete, or update statement against a MySQL datasource. Must be used within an [inline].
Parameters
none
Sample Usage
inline( ... );
'There were ' + row_count + ' records updated.';
/inline;
Source Code
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.
define_tag(
'row_count',
-priority='replace',
-description='
Returns the number of affected rows for the last insert,
delete, or update statement against a MySQL datasource.
'
);
// default to zero
local('out') = 0;
if(
lasso_datasourceismysql(database_name)
&& (
action_statement >> 'insert'
|| action_statement >> 'update'
|| action_statement >> 'delete'
)
);
protect;
inline( -sql='SELECT ROW_COUNT() AS changed');
#out = integer(field('changed'));
/inline;
/protect;
/if;
return(#out);
/define_tag;