|
|
Home Developer Manual 11. API Reference [WORKING] mosDBTable->bind |
| [WORKING] mosDBTable->bind |
|
|
|
|
Last reviewed: Not reviewed mosDBTable->bindCopy the contents of an array into the database table object. This function may be overloaded/supplemented by the child class as required. The table object is not saved; use mosDBTable->store for that. This function matches fields in the array with attributes of the same name in the table object. If a field exists in the array but does not match an attribute in the table object then it is ignored. If an attribute exists in the table object but does not match an array field then it will be ignored. Table object attributes with names beginning with an underscore character are always ignored. Returns true if successful; false otherwise. If false then the error message can be retrieved using the mosDBTable->getError function. Syntaxboolean bind ( array $array [, string $ignore ] )
ExamplesExample: This example uses the myTable class defined on the mosDBTable class overview page. global $database; // Declare an instance of the myTable class. $row = new myTable( $database ); // Load record with primary key $id. $row->load( $id ); // Update the title field in the database object. if (!$row->bind( $_POST, 'title' )) { mosErrorAlert( $row->getError() ); } // Save the updated record back to the database. if (!$row->store()) { mosErrorAlert( $row->getError() ); } Please report any errors on this page to the Developer Documentation Forum. |
|
| Last Updated ( Monday, 25 December 2006 ) |
| < Prev | Next > |
|---|





