602SQL Documentation Index  

PHP Module (General Information)

The PHP module for 602SQL is a shared library (php_602sqlXX.dll for Windows, php_602sqlXX.so for Linux) that allows provides access to a 602SQL Server from the PHP language. If you load the library into PHP (see below) you will be able to use the new functions with the wb_ prefix in PHP. See the function list below.

Module Installation

It is assumed that you have 602SQL Server and PHP working on your computer for the required operating system (Linux or Windows)

In order to load the PHP module, do the following:

The directory with PHP modules and the directory that contains the php.ini file can be found from the phpinfo() command.

Configuration Parameters in PHP.INI

The following parameters can be set in the PHP.INI file:

Example

A part of the PHP.INI file with the php_602sql module configuration parameters:

[602SQL]
wb_longreadlen = 4096
wb_binmode = WB_CONVERT
wb_datestring = 0
wb_max_links = -1
wb_max_persistent = -1
wb_allow_persistent = 1   

Information about the PHP Module Version

Information about the PHP module version is available in the form of 4 integer (INT) constants (PHP_602SQL_VERSION_MAJOR, PHP_602SQL_VERSION_MINOR, PHP_602SQL_VERSION_PATCH and PHP_602SQL_VERSION_PATCH2)

See

Example

A simple PHP script that works with a database. We assume that the wbserver is accessible and the Anonymous user has sufficient privileges. This script returns the list of 602SQL Server users.

$conn=wb_connect("wbserver", "_sysext", "Anonymous", "");
$res=wb_exec($conn, "select logname from Usertab where Ord(category)=CATEG_USER");
wb_result_all($res);
wb_close($res);
wb_close($conn);

List of topics: