Login   Register  
PHP Classes
elePHPant
Icontem

File: show_create_table.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mark Documento  >  Database Connection Classes  >  show_create_table.php  >  Download  
File: show_create_table.php
Role: Example script
Content type: text/plain
Description: Sample script 3
Class: Database Connection Classes
Abstract the access to SQL databases
Author: By
Last change:
Date: 2006-09-17 22:49
Size: 672 bytes
 

Contents

Class file image Download
<?php

try
{
    include_once(
"connection.inc.php");
    include_once(
"mysql_database.inc.php");

    
$db DBFactory::CreateDatabaseObject("MySqlDatabase");
    
$db->Connect($server$database$username$password);

    
$dt $db->Execute("SHOW CREATE TABLE test.person");
    
$dt->MoveNext();
    
$content "Table Definition<br><pre>";
    
$content .= $dt->Field("Create Table") . "<br>";
    
// or use:
    //$content .= $dt->Field(0) . "<br>";
    
$content .= "</pre>";
}
catch (
Exception $ex)
{
    
$content "Exception Caught: " $ex->getMessage() .
               
"<p>Trace: " $ex->getTraceAsString() . "</p>";
}

echo 
$content;

?>