Scripting/Squirrel/Functions/mysql affected rows: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		

This wiki is using an old backup from 2020
Some information may be old/missing
| m (Do not sign your edits) | No edit summary | ||
| (One intermediate revision by the same user not shown) | |||
| Line 13: | Line 13: | ||
| <pre>mysql_query(handler, "DELETE FROM account WHERE name LIKE 'A%'") | <pre>mysql_query(handler, "DELETE FROM account WHERE name LIKE 'A%'") | ||
| print("We deleted a total of " + mysql_affected_rows(handler) + " accounts starting with 'A'")</pre> | print("We deleted a total of " + mysql_affected_rows(handler) + " accounts starting with 'A'")</pre> | ||
| == Related Functions == | |||
| {{Scripting/Squirrel/Functions/MySQL Functions}} | |||
| [[Category:Scripting/Squirrel/Functions/Mysql_Functions]] | |||
Latest revision as of 18:27, 30 January 2017
Returns the number of changed rows (for UPDATE), inserted rows (for INSERT) or deleted rows (for DELETE) in the last query. For SELECT statements it works like mysql_num_rows.
Syntax
mysql_affected_rows ( MySQLConnection handler )
Arguments
- MySQLConnection handler - A valid MySQL link/handler
Return value
The number of affected rows in the last query.
Example
mysql_query(handler, "DELETE FROM account WHERE name LIKE 'A%'")
print("We deleted a total of " + mysql_affected_rows(handler) + " accounts starting with 'A'")