This is the supporting class that retrieves the tables views and creates the backup of the views .
This is an extension of the DBXML Class .
U will need this class to work with DBXML properly.
Any bugs or class design issuez in this class please mail "TAB_STRUCT : Bug Mail " in the subject line.
Any bugs or class design issuez in DBXML please mail "DBXML : Bug Mail " in the subject line.
if anybody have any job oppz for PHP or want support please feel free to contact me.It wuld b of great help.
NOTE: Be careful about the " '.A single change will cause problem in viewing the XML file.
The next class is coming for generation DTDs customised ones!!!
Thank you for the support
<?php
class TAB_STRUCT
{
function xml_tbl_create($tbl)
{
$creat="";
$sql = "SHOW CREATE TABLE ".$tbl."";
$res = mysql_query($sql) or die(mysql_error());
$creat="<create_table value=\"".$tbl."\">";
while ($row = mysql_fetch_assoc($res))
{
$creat=$creat.$row["Create Table"]."</create_table>";
}
return $creat;
}
function tbl_struct_xml($db,$tbl,$fnme)
{
$tt="";
mysql_select_db($db) or die("Could not select database");
$fnme=$fnme.$tbl."_STRUCT.xml";
$sql = "DESC ".$db.".".$tbl."";
$res = mysql_query($sql) or die(mysql_error());
$ft=fopen($fnme,"w");
$tt="<?xml version=\"1.0\"?".">"."<xml><".$db."><".$tbl."_struct>".TAB_STRUCT::xml_tbl_create($tbl).TAB_STRUCT::gen_insert($db,$tbl);
while ($row = mysql_fetch_assoc($res))
{