Source for file mktable.inc
Documentation is available at mktable.inc
* Creates the <kbd>phptest</kbd> table
* Tries to drop the table first, in case it already exists.
* b CHAR(40) DEFAULT 'def' NOT NULL,
* Need <kbd>NOT NULL</kbd> on <kbd>b</kbd> to test
* <kbd>DB_PORTABILITY_RTRIM</kbd>. MS SQL and Sybase trim output from
* <kbd>VARCHAR</kbd>, but not on <kbd>CHAR</kbd>.
* Need <kbd>DEFAULT</kbd> value on <kbd>b</kbd> because Oracle considers
* an empty string to be <kbd>NULL</kbd>.
* In Oracle, when using placeholders in <kbd>WHERE</kbd> clauses on
* <kbd>CHAR</kbd> columns, the column must have <kbd>RTRIM()</kbd> run on
* SELECT * FROM phptest WHERE RTRIM(b) = ?
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version $Id: mktable.inc,v 1.20 2007/01/05 15:12:56 danielc Exp $
* @link http://pear.php.net/package/DB
* Establishes the DB object and connects to the database
require_once './connect.inc';
* Get the drop_table() function
require_once './droptable.inc';
* The error handler for the drop table procedure
* Prints out an error message and dies.
$dbh->setErrorHandling (PEAR_ERROR_RETURN );
drop_table ($dbh, 'phptest');
//$dbh->setErrorHandling(PEAR_ERROR_TRIGGER);
$dbh->setErrorHandling (PEAR_ERROR_CALLBACK , 'debug_die');
if ($dbh->phptype == 'odbc') {
if ($dbh->dbsyntax == 'odbc') {
$default = "DEFAULT 'def' NOT NULL";
$default = "DEFAULT 'def' NOT NULL";
$date_literal = ' DATE ';
// doing this for ifx to keep certain versions happy
$default = "DEFAULT 'def' NOT NULL";
$default = "DEFAULT 'def' NOT NULL";
if (!empty ($needinnodb)) {
$tabletype = 'TYPE=INNODB';
$default = "DEFAULT 'def' NOT NULL";
// file exists or was created in DB_dbase::connect()
d $chrd $null) $tabletype
$dbh->query ($test_mktable_query);
$dbh->query ("INSERT INTO phptest VALUES(42, 'bing', 'This is a test', '1999-11-21')");
$dbh->setErrorHandling (PEAR_ERROR_RETURN );
Documentation generated on Tue, 20 Mar 2007 05:30:37 -0500 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.
|