my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT *stmt);
L'ordre Sql doit être un insert, update ou delete et non un select.
#include <mysql.h>
static MYSQL_STMT *hOrdreSql;
static my_ulonglong NbEnregistrements;
...
if (mysql_stmt_prepare(hOrdreSql, "select * from emp;", 18))
{
...
}
...
if (mysql_stmt_execute(hOrdreSql))
{
...
}
...
NbEnregistrements=mysql_affected_rows(hOrdreSql);
...