Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: g:\Work\WWW\php\tbox\lib/mysql.phps
PHP Documentation - PHP/Toolbox

g:\Work\WWW\php\tbox\lib/mysql.phps::mysql

DB interface module to MySQL.

 

private module mysql

DB interface module to MySQL.

 

Private Method Summary

void

check_db_error([ string $result, string $postfix ])

Checks if result of most recent query is successful.
int

do_query(string $sql)

Performs the db query and checks the errors.
void

fetch_query(string $sql, array &$result, [ string $mode ])

Fetches recordset as an array.
int

rset_rows(int $rset)

Returns row number from recordset.
void

free_result(int $rset)

Disposes the recordset.
mixed

fetch_record(int $rset, array &$result, [ string $mode ])

Fetches next record as a hash.
mixed

fetch_object(int $rset, object [unknown] &$result, [ string $mode ])

Fetches next record as a object.
mixed

fetch_field(int $rset, object [unknown] &$field, int $i)

Fetches field metainfo.
int

show_tables_like(string $wild, array &$result)

Returns array of database table names matching to wildcard.
void

sql_crypt( $pwd, string $salt)

Database-specific crypt function. *

Private Method Details

check_db_error

private void check_db_error( [ string $result, string $postfix ] )

  Checks if result of most recent query is successful.
It invokes func::phpx_assert().

Parameter
string $result = >>TRUE,<<
- xxx_query() result.
string $postfix = >>"--"<<
- the string to append to log.
Returns void


do_query

private int do_query( string $sql )

  Performs the db query and checks the errors.
| $rset = do_query ( | "select * from table ..." | ); | while (fetch_object($rset, $rec)) { | ... | } | free_result($rset);

Parameter
string $sql
- SQL statement.
Returns int

- query result (recordset).


fetch_query

private void fetch_query( string $sql, array &$result, [ string $mode ] )

  Fetches recordset as an array.
| $count = fetch_query ( | "select * from table ..." | $records | );

Parameter
string $sql
- SQL statement.
array &$result
- [out] record array.
string $mode = >>MYSQL_ASSOC<<
- what each record is. Useful to fetch *small* recordset only!
Returns void


rset_rows

private int rset_rows( int $rset )

  Returns row number from recordset.

Parameter
int $rset
- record set.
Returns int

- row number.


free_result

private void free_result( int $rset )

  Disposes the recordset.

Parameter
int $rset
- the recordset to dispose.
Returns void


fetch_record

private mixed fetch_record( int $rset, array &$result, [ string $mode ] )

  Fetches next record as a hash.

Parameter
int $rset
- recordset.
array &$result
- [out] record.
string $mode = >>MYSQL_ASSOC<<
- what the record is.
Returns mixed

- non-0 on success.


fetch_object

private mixed fetch_object( int $rset, object [unknown] &$result, [ string $mode ] )

  Fetches next record as a object.

Parameter
int $rset
- recordset.
object [unknown] &$result
- [out] record.
string $mode = >>MYSQL_ASSOC<<
- what the record is.
Returns mixed

- non-0 on success.


fetch_field

private mixed fetch_field( int $rset, object [unknown] &$field, int $i )

  Fetches field metainfo.
The output field contains at least thwo members:
  • name
  • type

Parameter
int $rset
- recordset.
object [unknown] &$field
- [out] field.
int $i
.
Returns mixed

- non-0 on success.


show_tables_like

private int show_tables_like( string $wild, array &$result )

  Returns array of database table names matching to wildcard.

Parameter
string $wild
- whildcard.
array &$result
- [out] names.
Returns int

- names count.


sql_crypt

private void sql_crypt( $pwd, string $salt )

  Database-specific crypt function. *

Parameter
$pwd
No additional comments.
string $salt
No additional comments.
Returns void



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta