Código PHP:
function CreateDBGridTable($DBGridName,$DBGridTitle)
{
// Creates the SQLite table that supports the DBGrid
$DBGridName = str_replace(" ","_",$DBGridName);
if (CheckDBGridName($DBGridName)==false)
{
DBGridError("Name must be alphanumeric and cannot begin with a number.");
return (false);
}
if (sqlite_table_exists($DBGridName))
{
DBGridError("Grid $DBGridName already exists.");
return (false);
}
$db = sqlite_open("data/DBGridDB.db");
$q="PRAGMA table_info($DBGridName)";
$r=sqlite_query($db,$q);
if (sqlite_num_rows($r)!=2)
{
if (!sqlite_query($db,"
CREATE TABLE $DBGridName (
col0 varchar(255)
)")
);
DBGridAddColumn($DBGridName);
DBGridAddRow($DBGridName);
DBGridAddRow($DBGridName);
//DBGridMessage("Table $DBGridName Created");
return (true);
}
else
{
DBGridMessage("Table Already Exists");
return (false);
}
return (false);
}
agradezco sus aportes.
chao