Function Module

Function Module – Module to handle SQL function abstraction

Description

The Function module provides methods for executing non-standard SQL database functions in a consistent way. The following document lists the available methods, providing examples of their use. To include the Function module functionality, you need to load it first.

Loading the Function module

<?php
require_once 'MDB2.php';
$dsn 'pgsql://someuser:apasswd@somehost';
$mdb2 =& MDB2::factory($dsn);
if (
PEAR::isError($mdb2)) {
    die(
$mdb2->getMessage());
}

// loading the Function module
$mdb2->loadModule('Function');
?>

After including the module, you can access its methods like this:

Get the length of a string expression

<?php
// PHP5
$mdb2->length('expression');
// PHP4 and PHP5
$mdb2->function->length('expression');
?>

Further in the document the PHP5-compatible way will be used.

Concatenate strings

<?php
$mdb2
->concat('string1''string2');
?>

Execute a Stored Procedure

Supposing we have the following Stored Procedure (MySQL syntax):

DELIMITER //
CREATE PROCEDURE procedure1 (IN parameter1 INTEGER)
BEGIN
  DECLARE variable1 CHAR(10);
  IF parameter1 = 17 THEN
    SET variable1 = 'birds';
  ELSE
    SET variable1 = 'beasts';
  END IF;
  INSERT INTO table1 VALUES (variable1);
END 
//
DELIMITER ;
we can call it this way:

Execute a Stored Procedure

<?php
$params 
= array(17);
$mdb2->executeStoredProc('procedure1'$params);
?>
NPO法人の設立はお任せ下さい

NPO法人とはという基本的内容から実際のNPO法人設立まで広くお手伝いいたします。これからNPO法人をお考えの方はオススメ。NPO法人とはNon Profit Organizationの略であり、特定非営利活動法人を指します。法人なので当然に登記され、独立した人格として活動ができるようになります。

これから引越しや転勤等で賃貸物件を探すなら、賃貸大阪homeへ
アクセスカウンター
アルバイトをお探しならアルバイトスタイルへ。アルバイトを探したい方、アルバイトを探している方は必見です。
NPO法人をこれから設立したいとお考えなら自分で設立するNPO法人へ。都道府県ごとのNPO法人設立情報などを提供。NPO法人証明書も発行
株式会社をこれから設立したいとお考えなら会社設立webへ。都道府県ごとの会社設立専門家を紹介しております。
メールフォームを製作するならメールフォームbizへ。納品できるメールフォームを製作