Листинг 4
<?php
/***************************************
** Title........: Execute Batch of SQL utility
** Filename.....: class.sql_batch.inc
***************************************/
class sql_batch{
var $host; // w: host
var $user; // w: user
var $password; // w: password
var $database; // w: database
var $sql_query; // w: batch of SQL query
var $sql_file; // w: file name of batch
var $list_names; // w: fields name encoding array
var $last_error; // r: last error string
var $pieces; // r: array of SQL query
var $sql_count; // r: count of SQL query array
var $sql_item; // r: [i] current number of SQL query
var $result; // r: result[i] of query
var $max_rows; // r: result[i] max rows
var $max_fields; // r: result[i] max fields
var $empty; // r: result[i] isEmpty
var $field_arr; // r: result[i] fields name array
var $numeric_arr; // r: result[i] numeric type array
var $row; // w: [j] result[i] current row
var $value_arr; // r: result[i] row[j] values array
/***************************************
** Constructor function. Sets up the
** above functions.
***************************************/
function sql_batch($sql_query = '',
$sql_file = '',
$list_names = array(),
$database = '',
$user = '',
$password = '',
$host = 'localhost'){
. . .