miModelSQLRecordHandle and manage the inserting, updating, deleting and reading of data from the database. This class works only with one record row specify by a table primary key or unique field.
Located in /model/SQLRecord.inc (line 23)
| Class | Description |
|---|---|
miModelGeneralOptionsRecord
|
Handle and manage deleting and reading of data from the database. |
Constructor miModelSQLRecord (line 154)
miModelSQLRecord constructor. It takes two parameters table name and table primary key
Example:
1 <?php
2 $ModelSQLRecord = new miModelSQLRecord('tableName', 'tablePrimaryKey');
3 ?>
delete (line 261)
Delete a record in the table
get (line 83)
Return the value of the given field from the array which hold the data for the next execution or last executed query
Example:
1 <?php
2 $ModelSQLRecord = new miModelSQLRecord('tableName', 'tablePrimaryKey');
3 $ModelSQLRecord->readPK($value);
4 $value = $ModelSQLRecord->get($someField);
5 ?>
getPrimaryKeyColumn (line 50)
Gets the primary key column of the table that this SQLRecord uses
getRow (line 119)
Return array which hold the data for the next execution or last executed query
Example:
1 <?php
2 $ModelSQLRecord = new miModelSQLRecord('tableName', 'tablePrimaryKey');
3 $ModelSQLRecord->readPK($value);
4 $row = $ModelSQLRecord->getRow();
5 ?>
getTableName (line 62)
Gets the table name of this SQLRecord
insert (line 233)
Insert a record in the table
read (line 178)
Read a record from a database table where specify unique field represented by $key is equal to the value represented by $value
Example:
1 <?php
2 $ModelSQLRecord = new miModelSQLRecord('tableName', 'tablePrimaryKey');
3 if ($ModelSQLRecord->read('uniqueField', $uniqueFieldValue))
4 $row = $ModelSQLRecord->getRow(); // now $row holds the result row
5 else echo 'No such record with ' . 'uniqueField = ' . $uniqueFieldValue;
6 ?>
readPK (line 209)
Read a record from a database table for a specify primary key value
Example:
1 <?php
2 $ModelSQLRecord = new miModelSQLRecord('tableName', 'tablePrimaryKey');
3 if ($ModelSQLRecord->readPK($value))
4 $row = $ModelSQLRecord->getRow(); // now $row holds the result row
5 else echo 'No such record with ' . 'uniqueField = ' . $uniqueFieldValue;
6 ?>
set (line 101)
Sets a value to the given field to the array which hold the data for the next execution or last executed query
Example:
1 <?php
2 $ModelSQLRecord = new miModelSQLRecord('tableName', 'tablePrimaryKey');
3 $ModelSQLRecord->set($field, $value);
4 ?>
setRow (line 136)
Sets array which hold the data for the next execution or last executed query
Example:
1 <?php
2 $ModelSQLRecord = new miModelSQLRecord('tableName', 'tablePrimaryKey');
3 $ModelSQLRecord->setRow($row); //$row is an array which hold data we wont to set.
4 ?>
update (line 246)
Update a record in the table
Documentation generated on Mon, 18 Oct 2004 14:58:32 +0300 by phpDocumentor 1.2.3