| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
Basic UsageBasic Usage – Example of how to use MDB2_TableBrowser
Creating a Table ObjectSteps to creating a table object out of your database table or view. This example connects to a mysql database animal_db and constructs a table object from the tbl_animals table. Create an MDB2 object:
<?php
Load the TableBrowser extention:
<?php
Create the table object Create a table browser for the tbl_animals table, and specify id as the primary key:
<?php
Retreiving DataA table object allows you several ways of retrieving data from the underlying table. The examples below continue from the animals_db database. Retrieving a single row is done via the getRows method. This call returns the row data as a hash array:
<?php
Retrieving multiple rows is done via the getRows method. This call returns an MDB2_Results object. From the animals db example... Get data the 3 animals in the table sorted by name starting with the 5th animal
<?php
Retrieving the different values in a column has is done via the getColumnValues method. In our example, we can get the different kinds of animals in tbl_animals eg: mammal, reptile,...
<?php
InsertingInserting a single row is done via insertRow method. It takes a single hash array as input.
<?php
Inserting multiple rows at once is done via insertRows method.
<?php
UpdatingUpdating a single row is done via updateRow method.
<?php
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「Basic Usage」をGoogle検索
|