...
This commit is contained in:
parent
7da003e8df
commit
17bfd27d3a
1 changed files with 3 additions and 15 deletions
|
@ -16,25 +16,13 @@ $link=mysqli_connect($iniarr['db_host'],$iniarr['db_admin_name'],$iniarr['db_adm
|
||||||
or mexit('Impossibile connettersi al database: '.mysqli_connect_error().' ['.mysqli_connect_errno().']'.N,1);
|
or mexit('Impossibile connettersi al database: '.mysqli_connect_error().' ['.mysqli_connect_errno().']'.N,1);
|
||||||
mysqli_set_charset($link,'utf8mb4');
|
mysqli_set_charset($link,'utf8mb4');
|
||||||
|
|
||||||
mysqli_query($link,"ALTER TABLE `ZStats` ADD `HitsLang` VARCHAR(5000) NOT NULL AFTER `Hits`;")
|
$res=mysqli_query($link,'SELECT * FROM ZStats');
|
||||||
or mexit(mysqli_error($link).N,2);
|
|
||||||
mysqli_query($link,"ALTER TABLE `ZStats` ADD `HitsPage` VARCHAR(5000) NOT NULL AFTER `HitsLang`;")
|
|
||||||
or mexit(mysqli_error($link).N,2);
|
|
||||||
|
|
||||||
$res=mysqli_query($link,"SELECT * FROM `ZStats`")
|
|
||||||
or mexit(mysqli_error($link).N,2);
|
|
||||||
|
|
||||||
$hlang;
|
|
||||||
$hpage;
|
$hpage;
|
||||||
while ($row=mysqli_fetch_assoc($res)) {
|
while ($row=mysqli_fetch_assoc($res)) {
|
||||||
$hlang='ca:'.$row['HitsCa'].';en:'.$row['HitsEn'].';es:'.$row['HitsEs'].';fr:'.$row['HitsFr'].';it:'.$row['HitsIt'];
|
$hpage=preg_replace(array('#inst#','#contrib#'),array('instances','contribute'),$row['HitsPage']);
|
||||||
$hpage='home:'.$row['HitsHome'].';inst:'.$row['HitsInst'].';about:'.$row['HitsAbout'].';stats:'.$row['HitsStats'].';contrib:'.$row['HitsContrib'].';404:'.$row['Hits404'];
|
mysqli_query($link,"UPDATE `ZStats` SET HitsPage='".$hpage."' WHERE TS=".$row['TS']);
|
||||||
mysqli_query($link,"UPDATE `ZStats` SET HitsLang='".$hlang."', HitsPage='".$hpage."' WHERE TS=".$row['TS']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mysqli_query($link,"ALTER TABLE `ZStats` DROP `HitsCa`, DROP `HitsEn`, DROP `HitsEs`, DROP `HitsFr`, DROP `HitsIt`, DROP `HitsHome`, DROP `HitsInst`, DROP `HitsAbout`, DROP `HitsStats`, DROP `HitsContrib`, DROP `Hits404`;")
|
|
||||||
or mexit(mysqli_error($link).N,2);
|
|
||||||
|
|
||||||
mysqli_close($link);
|
mysqli_close($link);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
Loading…
Reference in a new issue