Esempio n. 1
0
 /**
  * Determines the number of rows affected by a data maniuplation query
  *
  * 0 is returned for queries that don't manipulate data.
  *
  * @return int  the number of rows.  A DB_Error object on failure.
  */
 function affectedRows()
 {
     if (!$this->_result) {
         return 0;
     }
     return msql_affected_rows($this->_result);
 }
Esempio n. 2
0
 function Query($query)
 {
     $this->Debug("Query: {$query}");
     $first = $this->first_selected_row;
     $limit = $this->selected_row_limit;
     $this->first_selected_row = $this->selected_row_limit = 0;
     if (!$this->SelectDatabase()) {
         return 0;
     }
     if ($result = msql_query($query, $this->connection)) {
         if (substr(strtolower(ltrim($query)), 0, strlen("select")) == "select") {
             if ($limit > 0) {
                 $this->limits[$result] = array($first, $limit);
             }
             $this->highest_fetched_row[$result] = -1;
         }
         $this->affected_rows = msql_affected_rows($result);
     } else {
         return $this->SetError("Query", msql_error());
     }
     return $result;
 }
Esempio n. 3
0
 /**
  * Gets the number of rows affected by a query.
  *
  * @return number of rows affected by the last query
  */
 function affectedRows()
 {
     return @msql_affected_rows($this->connection);
 }
Esempio n. 4
0
function IsInArchive($dbi, $pagename)
{
    $pagename = addslashes($pagename);
    $query = "select pagename from archive where pagename='{$pagename}'";
    // echo "Query: $query<br>\n";
    if ($res = msql_query($query, $dbi['dbc'])) {
        return msql_affected_rows($res);
    }
}