Database::getAffectedRows PHP Method

getAffectedRows() public method

public getAffectedRows ( ) : integer
return integer
    public function getAffectedRows()
    {
        return intval($this->conn->affected_rows);
    }

Usage Example

Example #1
0
     $_SESSION['query_history'][md5(strtolower($queryStr))] = $queryStr;
     if (sizeof($_SESSION['query_history']) > $maxSavedQueries) {
         array_shift($_SESSION['query_history']);
     }
 }
 $query = explode_sql($delimiter, $queryStr);
 //explode the query string into individual queries based on the delimiter
 for ($i = 0; $i < sizeof($query); $i++) {
     if (str_replace(" ", "", str_replace("\n", "", str_replace("\r", "", $query[$i]))) != "") {
         $queryTimer = new MicroTimer();
         $result = $db->selectArray($query[$i], "assoc");
         $queryTimer->stop();
         echo "<div class='confirm'>";
         echo "<b>";
         if ($result !== NULL) {
             if (sizeof($result) > 0 || $db->getAffectedRows() == 0) {
                 printf($lang['show_rows'], sizeof($result));
             }
             if ($db->getAffectedRows() > 0 || sizeof($result) == 0) {
                 echo $db->getAffectedRows() . " " . $lang['rows_aff'] . " ";
             }
             printf($lang['query_time'], $queryTimer);
             echo "</b><br/>";
         } else {
             echo $lang['err'] . ": " . $db->getError() . "</b><br/>";
         }
         echo "<span style='font-size:11px;'>" . htmlencode($query[$i]) . "</span>";
         echo "</div><br/>";
         if (sizeof($result) > 0) {
             $headers = array_keys($result[0]);
             echo "<table border='0' cellpadding='2' cellspacing='1' class='viewTable'>";
All Usage Examples Of Database::getAffectedRows