version 1.145, 2004/07/13 17:59:33 |
version 1.146, 2004/07/15 10:40:19 |
|
|
* http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
*/ |
|
|
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.144 2004/06/30 17:54:09 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.145 2004/07/13 17:59:33 nepto Exp $ */ |
|
|
/* This is a generic table editing program. The table and fields to be |
/* This is a generic table editing program. The table and fields to be |
edited are defined in the calling program. |
edited are defined in the calling program. |
|
|
var $db; // database |
var $db; // database |
var $tb; // table |
var $tb; // table |
var $dbh; // database handle |
var $dbh; // database handle |
|
var $close_dbh; // if database handle should be closed |
|
|
// Record manipulation |
// Record manipulation |
var $key; // name of field which is the unique key |
var $key; // name of field which is the unique key |
Line 2736 function phpMyEdit_filter_handler(theFor |
|
Line 2737 function phpMyEdit_filter_handler(theFor |
|
*/ |
*/ |
function connect() /* {{{ */ |
function connect() /* {{{ */ |
{ |
{ |
|
if (isset($this->dbh)) { |
|
return true; |
|
} |
if (!isset($this->db)) { |
if (!isset($this->db)) { |
$this->error('no database defined'); |
$this->error('no database defined'); |
return false; |
return false; |
Line 2757 function phpMyEdit_filter_handler(theFor |
|
Line 2761 function phpMyEdit_filter_handler(theFor |
|
*/ |
*/ |
function disconnect() /* {{{ */ |
function disconnect() /* {{{ */ |
{ |
{ |
@mysql_close($this->dbh); |
if ($this->close_dbh) { |
unset($this->dbh); |
@mysql_close($this->dbh); |
|
$this->dbh = null; |
|
} |
} /* }}} */ |
} /* }}} */ |
|
|
/* |
/* |
Line 2878 function phpMyEdit_filter_handler(theFor |
|
Line 2884 function phpMyEdit_filter_handler(theFor |
|
{ |
{ |
// Set desirable error reporting level |
// Set desirable error reporting level |
$error_reporting = error_reporting(E_ALL & ~E_NOTICE); |
$error_reporting = error_reporting(E_ALL & ~E_NOTICE); |
// Instance class variables |
// Database handle variables |
$this->hn = $opts['hn']; |
if (isset($opts['dbh'])) { |
$this->un = $opts['un']; |
$this->close_dbh = false; |
$this->pw = $opts['pw']; |
$this->dbh = $opts['dbh']; |
$this->db = $opts['db']; |
} else { |
$this->tb = $opts['tb']; |
$this->close_dbh = true; |
|
$this->dbh = null; |
|
$this->hn = $opts['hn']; |
|
$this->un = $opts['un']; |
|
$this->pw = $opts['pw']; |
|
$this->db = $opts['db']; |
|
$this->tb = $opts['tb']; |
|
} |
|
// Other variables |
$this->key = $opts['key']; |
$this->key = $opts['key']; |
$this->key_type = $opts['key_type']; |
$this->key_type = $opts['key_type']; |
$this->inc = $opts['inc']; |
$this->inc = $opts['inc']; |