PDO4You\PDO4You::rowCount PHP Метод

rowCount() публичный статический Метод

Method that returns the number of rows affected by the last CRUD (INSERT, SELECT, UPDATE, or DELETE)
public static rowCount ( ) : string
Результат string
    public static function rowCount()
    {
        $count = is_array(self::$rowCount) ? self::countWhere(self::$rowCount, '>', 0) : self::$rowCount;
        return $count;
    }

Usage Example

Пример #1
0
 /**
  * Format the Result
  * 
  */
 private function getResult($result, $show_lastid = false)
 {
     $result = '<br /><br /> - The code above will output: <pre style="color:blue;">' . print_r($this->sanitize($result), true) . '</pre>';
     $result .= 'Total records affected: <strong style="color:red;">' . PDO4You::rowCount() . '</strong>';
     $result .= $show_lastid ? '&nbsp;&nbsp; Id of the last iteration: <strong style="color:red;">' . PDO4You::lastId() . '</strong>' : null;
     return $result;
 }