International PHP Conference 2019 - Spring Edition


(PHP 4 >= 4.0.4, PHP 5, PECL odbtp >= 1.1.1)

mssql_rows_affected Retorna o número de registros afetados pela query


int mssql_rows_affected ( resource $conn_id )

Esta função não está documentada; somente a lista de argumentos está disponível.

add a note add a note

User Contributed Notes 1 note

rowan dot collins at gmail dot com
11 years ago
Note that, as the page says, this function expects an MSSQL *Link* resource, not a *result* resource. This is a bit counter-intuitive, and differs from, for instance, pg_affected_rows (though not, apparently, mysql_affected_rows).

= mssql_pconnect($db_host,$db_user,$db_pass);
mssql_select_db($db_name, $link);

$result = mssql_query('Select 1', $link);

$rows = mssql_rows_affected($result); # ERROR!
$rows = mssql_rows_affected($link); # Correct
To Top