Your browser must have JavaScript enabled in order to view this page.
 >  >
 
Welcome Guest#1838 Login/register    Go to Bottom
Go to Top

Procedural File: dpdb_mysql.php

SOURCE LOCATION:  /lib/dpdb_mysql.php

File Overview

MySQL database functions

A very simple layer over MySQL functions, providing the same interface as dpdb_mdb2.php (which is a layer over the MDB2 database abstraction layer). Either this file or dpdb_mdb2.php is included, based on settings in dpuniverse-ini.php.

DutchPIPE version 0.4; PHP version 5

LICENSE: This source file is subject to version 1.0 of the DutchPIPE license. If you did not receive a copy of the DutchPIPE license, you can obtain one at http://dutchpipe.org/license/1_0.txt or by sending a note to license@dutchpipe.org, in which case you will be mailed a copy immediately.


SEE:  dpuniverse-ini.php, dpdb_mdb2.php
SINCE:  DutchPIPE 0.4.0
FILESOURCE:  Source Code for this file
LINK:  http://dutchpipe.org/manual/package/DutchPIPE
VERSION:  Subversion: $Id: dpdb_mysql.php 293 2007-08-25 23:11:20Z ls $
COPYRIGHT:  2006, 2007 Lennert Stock
LICENSE:  DutchPIPE License
AUTHOR:  Lennert Stock <ls@dutchpipe.org>

Functions

dp_db_connect  [line 45]
boolean &dp_db_connect( )

Connects to the database server and sets it the current database

Prints an error message to the server output in case of an error

RETURNS:  boolean  MySQL link identifier on success, FALSE on failure
SEE:  DPUNIVERSE_MYSQL_HOST, PUNIVERSE_MYSQL_USER, DPUNIVERSE_MYSQL_PASSWORD, http://www.php.net/mysql_connect, http://www.php.net/mysql_select_db, dp_db_query(), dp_db_exec(), dp_db_fetch_one(), dp_db_fetch_row(), dp_db_quote(), dp_db_num_rows(), dp_db_next_id(), dp_db_free()
dp_db_exec  [line 110]
mixed dp_db_exec( string $sql   )

Sends a MySQL query of type DELETE, INSERT, REPLACE, UPDATE, ...

Prints an error message to the server output in case of an error

PARAMETERS:
string   $sql:  SQL statement

RETURNS:  mixed  number of affected rows or FALSE on failure
SEE:  http://www.php.net/mysql_query, dp_db_connect(), dp_db_query(), dp_db_quote(), dp_db_next_id()
dp_db_fetch_one  [line 139]
mixed dp_db_fetch_one( resource $result , int $row , [int $field = 0]   )

Gets result data

Prints an error message to the server output in case of an error

PARAMETERS:
resource   $result:  result resource from dp_db_query()
int   $row:  row number from result, starts at 0
int   $field:  optional field name or offset, 0 by default

RETURNS:  mixed  string with contents of one cell, or FALSE on failure
SEE:  http://www.php.net/mysql_result, dp_db_connect(), dp_db_query(), dp_db_fetch_row(), dp_db_quote(), dp_db_num_rows(), dp_db_free()
dp_db_fetch_row  [line 158]
mixed &dp_db_fetch_row( resource $result   )

Gets a result row as an enumerated array
PARAMETERS:
resource   $result:  result resource from dp_db_query()

RETURNS:  mixed  numerical array of strings with row data, FALSE if there are no more rows
SEE:  http://www.php.net/mysql_fetch_row, dp_db_connect(), dp_db_query(), dp_db_fetch_one(), dp_db_quote(), dp_db_num_rows(), dp_db_free()
dp_db_free  [line 244]
boolean dp_db_free( resource $result   )

Frees result memory
PARAMETERS:
resource   $result:  result resource from dp_db_query()

RETURNS:  boolean  TRUE on success or FALSE on failure
SEE:  http://www.php.net/mysql_free_result, dp_db_query(), dp_db_fetch_one(), dp_db_fetch_row()
dp_db_next_id  [line 214]
mixed dp_db_next_id( string $table , string $idColumn   )

Gets the next primary ID for an INSERT

Prints an error message to the server output in case of an error

PARAMETERS:
string   $table:  table name
string   $idColumn:  field name

RETURNS:  mixed  integer with next id, or FALSE on failure
SEE:  dp_db_exec()
dp_db_num_rows  [line 194]
mixed dp_db_num_rows( resource $result   )

Gets number of rows in result

Prints an error message to the server output in case of an error

PARAMETERS:
resource   $result:  result resource from dp_db_query()

RETURNS:  mixed  number of rows in a result set, or FALSE on failure
SEE:  http://www.php.net/mysql_num_rows, dp_db_query()
dp_db_query  [line 85]
mixed dp_db_query( string $sql   )

Sends a MySQL query of type SELECT, SHOW, EXPLAIN, DESCRIBE, ...

Prints an error message to the server output in case of an error

PARAMETERS:
string   $sql:  SQL statement

RETURNS:  mixed  a MySQL resource or FALSE on failure
SEE:  http://www.php.net/mysql_query, dp_db_connect(), dp_db_exec(), dp_db_fetch_one(), dp_db_fetch_row(), dp_db_quote(), dp_db_num_rows(), dp_db_free()
dp_db_quote  [line 175]
mixed dp_db_quote( string $val , [ $type = NULL] , [ $quote = TRUE] , [ $escWildcards = FALSE]   )

Escapes special characters in a string for use in a SQL statement

Escapes the value given in the first argument. All other arguments are ignored and only used, when given, by the MDB2 equivalent function.

PARAMETERS:
string   $val:  string that is to be escaped
   $type: 
   $quote: 
   $escWildcards: 

RETURNS:  mixed  escaped string, or FALSE on error
SEE:  http://www.php.net/mysql_real_escape_string, dp_db_query(), dp_db_exec()

Documentation generated on Mon, 03 Sep 2007 22:19:09 +0200 by phpDocumentor 1.3.0RC6

Click me!
Guest#1838
 
 
 
  Go to Top
 
 
Input Field OptionsClose Input Field Go to Top
 
Legal Notices | Copyright © 2006, 2007 Lennert Stock. All rights reserved. Last update: Mon Sep 03 2007, 21:50 CET.