From the index.php file:
function intTableExists($table) {
// Modified 2008-05-10 [v1.1] by Ralph to use FROM clause
// function to determine whether or not a specific database table exists
// $table = the table name, including prefix, to check for existence
// example: $table = "etomite_new_table"
// Returns boolean TRUE or FALSE
if($table == null) return false;
$query = "SHOW TABLE STATUS FROM ".$this->dbConfig['dbase']." LIKE '".$table."'";
$rs = $this->dbQuery($query);
return ($row = $this->fetchRow($rs)) ? true : false;
}
This API is good to determine whether a table exists and it is often used to wrap an SQL CREATE query that will actually create a table if this API returns false.
NOTE: This API was changed in V1.1 to stop errors of implementation, but the API may cause errors of implementation in older versions of etomite (0.6.1.4 and earlier).
To make a backward compatible implementation, the API can be used like this:
if($etomite->intTableExists('tablename') !== true){
<<insert CREATE table code here>>
}
for v1.1+ it can be used like this:
if(!$etomite->intTableExists('tablename')){
<<insert CREATE table code here>>
}
Edited by Cris D., 03 March 2009 - 06:19 PM.











