0

Im using adodb and want to have the count of affected rows of an update statement:

$sql = "UPDATE newsletter
        SET
        datetime_confirm = NOW(),
        confirmation_code = NULL
        WHERE
        confirmation_code = ?";
    $sqlP = $db->Prepare($sql);
    $prepareVals = array($confirmationCode);
    $result = $db->Execute($sqlP, $prepareVals);

In my example there is one entry with the given confirmation_code in the newsletter table. So one row gets updatet. So I need the count '1'.

Edit: Not a dublicate because Im searching for a specific method of the adodb framework which archive this.

TmCrafz
  • 184
  • 1
  • 12
  • How about `SELECT ROW_COUNT();` **[`ROW_COUNT()`](https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_row-count)** – Ilyes Dec 24 '18 at 11:12
  • 1
    Is [`affected_rows()`](http://adodb.org/dokuwiki/doku.php?id=v5:reference:connection:affected_rows) what your after? – Nigel Ren Dec 24 '18 at 11:24
  • @NigelRen that was exactly what I was searching for. Thank you. – TmCrafz Dec 24 '18 at 11:35

0 Answers0