Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
SQLParser Class Reference

Public Member Functions

 executeFile ($file, $failOnError=true)
 getErrorMsg ()
parseStatements (&$sql)
 SQLParser ($driver, &$dataSource, $debug=false)
 stripComments (&$sql)

Public Attributes


Detailed Description

Class for parsing and executing statements in SQL files.

Definition at line 17 of file

Member Function Documentation

SQLParser::executeFile (   $file,
  $failOnError = true 

Parse an SQL file and execute all SQL statements in it.

$filestring full path to the file
$failOnErrorboolean stop execution if an error is encountered
boolean true if no errors occurred, false otherwise

Definition at line 75 of file

SQLParser::getErrorMsg ( )

Return the last error message that occurred in parsing.


Definition at line 161 of file

& SQLParser::parseStatements ( $sql)

Parse SQL content into individual SQL statements.


Definition at line 123 of file

SQLParser::SQLParser (   $driver,
  $debug = false 


$driverstring the database driver (currently only "mysql" is supported)
$debugboolean echo each statement as it's executed

Definition at line 60 of file

SQLParser::stripComments ( $sql)

Strip SQL comments from SQL string.


Definition at line 114 of file

Member Data Documentation

string SQLParser::$commentDelim

Delimiter for SQL comments used by the data source

Definition at line 47 of file

object SQLParser::$dataSource

The database connection object

Definition at line 29 of file

boolean SQLParser::$debug

Enable debugging (print SQL statements as they are executed)

Definition at line 35 of file

string SQLParser::$driver

The database driver

Definition at line 23 of file

string SQLParser::$errorMsg

Error message

Definition at line 41 of file

string SQLParser::$statementDelim

Delimiter for SQL statements used by the data source

Definition at line 53 of file

The documentation for this class was generated from the following file: