phpgeocache
[ class tree: phpgeocache ] [ index: phpgeocache ] [ all elements ]

Class: GeocacheDB

Source Location: /db-mysql.inc.php

Class Overview


MySQL functions for PHPGeocache


Author(s):

Version:

  • 1.0

Variables

Methods



Class Details

[line 35]
MySQL functions for PHPGeocache

This file contains the basic database functions for the MySQL database.

http://www.phpgeocache.org

Copyright (c) 2006 Sascha Kimmel, tricos media (www.tricos.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.




Tags:

version:  1.0
author:  Sascha Kimmel <skimmel@tricosmedia.de>


[ Top ]


Class Variables

$lastError =

[line 89]

The last error which occured.



Tags:

since:  1.0
access:  public

Type:   string


[ Top ]



Class Methods


constructor __construct [line 120]

GeocacheDB __construct( string $server, string $user, string $password, string $database)

The PHP5 constructor.

Assigns the values to this object without connecting to the database automatically.




Tags:

since:  1.0
access:  public


Parameters:

string   $server   The database server name or IP
string   $user   The database user
string   $password   The database password
string   $database   The database name

[ Top ]

constructor GeocacheDB [line 103]

GeocacheDB GeocacheDB( string $server, string $user, string $password, string $database)

The PHP4 constructor.

Assigns the values to this object without connecting to the database automatically.




Tags:

since:  1.0
access:  public


Parameters:

string   $server   The database server name or IP
string   $user   The database user
string   $password   The database password
string   $database   The database name

[ Top ]

method close [line 408]

void close( )

Closes the MySQL connection.



Tags:

since:  1.0
access:  public


[ Top ]

method connect [line 136]

bool connect( )

Establishes a connection to the database server given and selects the database given.



Tags:

since:  1.0
access:  public


[ Top ]

method delete [line 283]

integer|bool delete( string $sql)

Used for executing DELETE statements. Returns the last AUTOINCREMENT value.



Tags:

since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed

[ Top ]

method escape [line 162]

string escape( string $string)

Escapes a string for the database to prevent both errors and SQL injection.

This is defined here so that other databases can also be used with this interface. This is simply a wrapper function.




Tags:

since:  1.0
access:  public


Parameters:

string   $string  

[ Top ]

method escapeFieldName [line 193]

void escapeFieldName( mixed $field)

Escapes special reserved field names.

This is defined here so that other databases can also be used with this interface.




Tags:

since:  1.0
access:  public


[ Top ]

method escapeFieldNames [line 176]

void escapeFieldNames( mixed &$fields)

Escapes special reserved field names.

This is defined here so that other databases can also be used with this interface.




Tags:

since:  1.0
access:  public


[ Top ]

method getAll [line 299]

array|bool getAll( string $sql)

Executes the given SQL statement and returns all rows from the result set as an associative array.

If you know there is only one row you should use getOne() instead.




Tags:

see:  GeocacheDB::getOne()
since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed

[ Top ]

method getAllByField [line 331]

array|bool getAllByField( string $sql, string $field)

Executes the given SQL statement and returns a one-dimensional array containing all values of the given field in all all rows from the result set



Tags:

since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed
string   $field   The name of the field in the result set to be returned

[ Top ]

method getOne [line 363]

array|bool getOne( string $sql)

Executes the given SQL statement and returns only the first row from the result set.

If you wish to retrieve more rows you should use getAll() instead.




Tags:

see:  GeocacheDB::getAll()
since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed

[ Top ]

method getOneField [line 388]

array|bool getOneField( string $sql, string $field)

Executes the given SQL statement and returns only the value of the field given from the first row from the result set.

If you wish to retrieve more rows you should use getAllByField() instead.




Tags:

see:  GeocacheDB::getAllByField()
since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed
string   $field   The name of the field whose value should be returned.

[ Top ]

method insert [line 235]

integer|bool insert( string $sql)

Used for executing INSERT statements. Returns the last AUTOINCREMENT value.



Tags:

since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed

[ Top ]

method query [line 211]

integer|bool query( string $sql)

Queries the database.

This is defined here so that other databases can also be used with this interface.




Tags:

since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed

[ Top ]

method update [line 259]

integer|bool update( string $sql)

Used for executing UPDATE statements. Returns the number of affected rows.



Tags:

since:  1.0
access:  public


Parameters:

string   $sql   The SQL statement to be executed

[ Top ]


Documentation generated on Mon, 29 May 2006 19:21:33 +0200 by phpDocumentor 1.3.0RC6