| Жалко!
Сделал так!
function savebase(){//сохраняю базу
mysql_query("DROP TABLE IF EXISTS 'asutp'.'acpcopy'");
$sqlt = "CREATE TABLE 'acpcopy' (
'id' char(6) NOT NULL default '',
'task' char(10) NOT NULL default '',
'tag' char(10) NOT NULL default '',
'min' float(10,2) default '0.00',
'max' float(10,2) default '0.00',
'min_' float(10,2) default '0.00',
'max_' float(10,2) default '0.00',
'name' char(45) default NULL,
'value' float(10,2) default '0.00',
'h0' float(10,4) default NULL,
'h1' float(10,4) default NULL,
'h2' float(10,4) default NULL,
'h3' float(10,4) default NULL,
'h4' float(10,4) default NULL,
'h5' float(10,4) default NULL,
'h6' float(10,4) default NULL,
'h7' float(10,4) default NULL,
'h8' float(10,4) default NULL,
'h9' float(10,4) default NULL,
'h10' float(10,4) default NULL,
'h11' float(10,4) default NULL,
'h12' float(10,4) default NULL,
'h13' float(10,4) default NULL,
'h14' float(10,4) default NULL,
'h15' float(10,4) default NULL,
'h16' float(10,4) default NULL,
'h17' float(10,4) default NULL,
'h18' float(10,4) default NULL,
'h19' float(10,4) default NULL,
'h20' float(10,4) default NULL,
'h21' float(10,4) default NULL,
'h22' float(10,4) default NULL,
'h23' float(10,4) default NULL,
'day' float(10,4) default NULL,
PRIMARY KEY ('id')
)SELECT * FROM 'acp'";
@mysql_query($sqlt) and print('Копия базы данных 'acp' созданна, под именем 'acpcopy'') or die (mysql_error());
}
function loadbase(){//обновляю оригинал из копии
mysql_query("DROP TABLE IF EXISTS 'asutp'.'acp'");
$sqlt = "CREATE TABLE 'acp' (
'id' char(6) NOT NULL default '',
'task' char(10) NOT NULL default '',
'tag' char(10) NOT NULL default '',
'min' float(10,2) default '0.00',
'max' float(10,2) default '0.00',
'min_' float(10,2) default '0.00',
'max_' float(10,2) default '0.00',
'name' char(45) default NULL,
'value' float(10,2) default '0.00',
'h0' float(10,4) default NULL,
'h1' float(10,4) default NULL,
'h2' float(10,4) default NULL,
'h3' float(10,4) default NULL,
'h4' float(10,4) default NULL,
'h5' float(10,4) default NULL,
'h6' float(10,4) default NULL,
'h7' float(10,4) default NULL,
'h8' float(10,4) default NULL,
'h9' float(10,4) default NULL,
'h10' float(10,4) default NULL,
'h11' float(10,4) default NULL,
'h12' float(10,4) default NULL,
'h13' float(10,4) default NULL,
'h14' float(10,4) default NULL,
'h15' float(10,4) default NULL,
'h16' float(10,4) default NULL,
'h17' float(10,4) default NULL,
'h18' float(10,4) default NULL,
'h19' float(10,4) default NULL,
'h20' float(10,4) default NULL,
'h21' float(10,4) default NULL,
'h22' float(10,4) default NULL,
'h23' float(10,4) default NULL,
'day' float(10,4) default NULL,
PRIMARY KEY ('id')
)SELECT * FROM 'acpcopy'";
@mysql_query($sqlt) and print('Оригинал 'acp' обновляется из базы 'acpcopy'....') or die (mysql_error());
}
|
| |