Class RemoteQuery

Description

Remote Query Client Class Executes a query on a remote server. (Requires server file)

July 04, 2007 - Written by Jeff Williams (Initial Release)
July 14, 2007 - Improved error handling

  • author: Jeff L. Williams
  • version: 1.1

http://www.phpclasses.org/browse/package/4000.html


Variable Summary
float $duration
string $error
string $lastSQL
integer $rowCount
Method Summary
RemoteQuery __construct ([string $url = ''], [string $securityKey = ''], [string $database = ''], [string $server = ''], [string $username = ''], [string $password = ''], [string $charset = ''])
void connect (string $url, [string $securityKey = ''], [string $database = ''], [string $server = ''], [string $username = ''], [string $password = ''], [string $charset = ''])
array executeQuery (string $sql)
string getURL ([string $sql = ''])
Variables
float $duration (line 30)

The duration of a query in microseconds

  • access: public
string $error = '' (line 51)

Contains the error message returned from the last error

  • access: public
string $lastSQL = '' (line 44)

The last SQL statement executed

  • access: public
integer $rowCount = 0 (line 37)

The total number of rows returned from the last query

  • access: public
Methods
Constructor __construct (line 64)

CONSTRUCTOR

  • access: public
RemoteQuery __construct ([string $url = ''], [string $securityKey = ''], [string $database = ''], [string $server = ''], [string $username = ''], [string $password = ''], [string $charset = ''])
  • string $url: The URL to the Remote Query Server file
  • string $securityKey: Security password key (set in the Remote Query Server file)
  • string $database: Name of the database
  • string $server: Name of the MySQL host server
  • string $username: Database user name
  • string $password: Database password
  • string $charset: Database character set
connect (line 82)

Sets connection data for the remote database and Remote Query Server

  • access: public
void connect (string $url, [string $securityKey = ''], [string $database = ''], [string $server = ''], [string $username = ''], [string $password = ''], [string $charset = ''])
  • string $url: The URL to the Remote Query Server file
  • string $securityKey: Security password key (set in the Remote Query Server file)
  • string $database: Name of the database
  • string $server: Name of the MySQL host server
  • string $username: Database user name
  • string $password: Database password
  • string $charset: Database character set
executeQuery (line 102)

Executes a query on the remote server

  • return: An associative array containing the result set
  • access: public
array executeQuery (string $sql)
  • string $sql: SQL query to execute on the remote server
getURL (line 175)

Creates the full URL with GET parameters to execute a query on the server

  • return: Full URL to return XML result set from remote server
  • access: public
string getURL ([string $sql = ''])
  • string $sql: SQL query to execute

http://www.phpclasses.org/browse/package/4000.html