You are here

function DB::isManip in Flickr API 5

Tell whether a query is a data manipulation or data definition query

Examples of data manipulation queries are INSERT, UPDATE and DELETE. Examples of data definition queries are CREATE, DROP, ALTER, GRANT, REVOKE.

Parameters

string $query the query:

Return value

boolean whether $query is a data manipulation query

4 calls to DB::isManip()
DB_mysql::affectedRows in phpFlickr/PEAR/DB/mysql.php
Determines the number of rows affected by a data maniuplation query
DB_mysql::modifyLimitQuery in phpFlickr/PEAR/DB/mysql.php
Adds LIMIT clauses to a query string according to current DBMS standards
DB_mysql::simpleQuery in phpFlickr/PEAR/DB/mysql.php
Sends a query to the database server
DB_pgsql::simpleQuery in phpFlickr/PEAR/DB/pgsql.php
Sends a query to the database server

File

phpFlickr/PEAR/DB.php, line 623

Class

DB
Database independent query interface

Code

function isManip($query) {
  $manips = 'INSERT|UPDATE|DELETE|REPLACE|' . 'CREATE|DROP|' . 'LOAD DATA|SELECT .* INTO|COPY|' . 'ALTER|GRANT|REVOKE|' . 'LOCK|UNLOCK';
  if (preg_match('/^\\s*"?(' . $manips . ')\\s+/i', $query)) {
    return true;
  }
  return false;
}