Modules/MTA-MySQL/mysql affected rows: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
<pageclass class="#AA7592" subcaption="MTA-MySQL Module"></pageclass> | |||
__NOTOC__ | __NOTOC__ | ||
{{ModuleFunction|MTA-MySQL}} | {{ModuleFunction|MTA-MySQL}} |
Latest revision as of 17:41, 5 January 2011
This function is provided by the external module MTA-MySQL. You must install this module to use this function. | |
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
int mysql_affected_rows ( MySQLConnection handler )
Required arguments
- handler: A valid MySQL link
Returns
The number of affected rows in the last query.
Example
Example 1: This example shows the number of deleted rows after deleting all accounts starting with 'A'
mysql_query(handler, "DELETE FROM account WHERE name LIKE 'A%'") outputDebugString("We deleted a total of " .. mysql_affected_rows(handle) .. " accounts starting with 'A'")
See also
- mysql_connect
- mysql_close
- mysql_errno
- mysql_error
- mysql_ping
- mysql_select_db
- mysql_escape_string
- mysql_affected_rows
- mysql_change_user
- mysql_get_character_set_info
- mysql_get_client_info
- mysql_get_client_version
- mysql_get_host_info
- mysql_get_proto_info
- mysql_get_server_info
- mysql_get_server_version
- mysql_hex_string
- mysql_info
- mysql_insert_id
- mysql_query
- mysql_unbuffered_query
- mysql_set_character_set
- mysql_stat
- mysql_warning_count