< TIMESTAMP: Setting Column Type   (Previous) Table of Contents (Next)   TIMESTAMP: Formatting >

TIMESTAMP: Getting Column Type

/**
 * Returns the SQL keyword for TIMESTAMP data types in CREATE TABLE
 * statements
 *
 * @return  string   the query fragment your DBMS needs
 */
function getTimestampType() {
    return $this->TimestampType;
}

require 'connect.inc';

$query = 'CREATE TABLE xyz (ts ' . $p->getTimestampType() . ')';
echo $query;
$db->query($query);
$db->query('DROP TABLE xyz ' . $p->getDropRestrict());
mysql
CREATE TABLE xyz (ts DATETIME )
fbsql
CREATE TABLE xyz (ts TIMESTAMP )