 |
 |
 |
 |
 |
| Author |
Message |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2818 Location: Germany |
|
Size of the database in main.mdu |
|
This little hack adds the table size to the statistics part in main.mdu.
Open main.mdu and find this:
 |  | echoheader('home', $echo['header']); |
add below:
 |  | if ($config_database != 'txtsql'){
//////////////////////
//Check the table size
$query = "SHOW TABLE STATUS";
$result = mysql_query($query);
$i = 0;
while($row = mysql_fetch_array($result)){
$output[$i] = $row['Data_length'];
$i++;
}
$size = array('users' => $output[6], 'story' => $output[4] + $output[5], 'comments' => $output[1], 'categories' => $output[0]);
} |
Find this:
 |  | if ($config_database == 'txtsql'){
?>
(<small><?=formatsize(filesize(rootpath.'/data/db/base/'.$k.'.MYD')); ?></small>)
<?
} |
add below:
 |  | else {?><td align="right"><small><?=formatsize($size[$k]); ?></small></td><?} |
Or get it with the latest CuteNews.RU download file.
|
|
| Fri Oct 21, 2005 11:22 am |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
lexa
Creator of CuteNews.RU

Joined: 02 Oct 2005 Posts: 90 Location: St.-Petersburg, Russia |
|
|
|
Super! I add it.
|
|
| Fri Oct 21, 2005 7:05 pm |
 |
 |
Mr R

Joined: 27 Sep 2005 Posts: 82 Location: Spain |
|
|
|
how can we put in main "optimization of database" and "backup of data" base information as txt
|
|
| Fri Oct 21, 2005 7:09 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2818 Location: Germany |
|
|
|
 |  | how can we put in main "optimization of database" and "backup of data" base information as txt |
"Optimization of database" - I made this for CuteSQL. I can add it without problems. Tomorrow.
"Backup of data" - I don't know.
|
|
| Sat Oct 22, 2005 1:15 pm |
|
 |
Mr R

Joined: 27 Sep 2005 Posts: 82 Location: Spain |
|
|
|
Haha ok, database backup like phpbb have look, you can download your database information as a txt file
|
|
| Sat Oct 22, 2005 2:02 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2818 Location: Germany |
|
|
|
Of course.
I didn't mean to say "I don't know what it is" but "I don't know how to do it".
|
|
| Sat Oct 22, 2005 2:06 pm |
|
 |
Mr R

Joined: 27 Sep 2005 Posts: 82 Location: Spain |
|
|
|
haha ok, don't worry, my failure i can wait
|
|
| Sat Oct 22, 2005 2:26 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2818 Location: Germany |
|
|
|
"Optimization of database":
In main.mdu change this:
 |  | if ($config_database != 'txtsql'){
//////////////////////
//Check the table size
$query = "SHOW TABLE STATUS";
$result = mysql_query($query);
$i = 0;
while($row = mysql_fetch_array($result)){
$output[$i] = $row['Data_length'];
$i++;
}
$size = array('users' => $output[6], 'story' => $output[4] + $output[5], 'comments' => $output[1], 'categories' => $output[0]);
} |
to this:
 |  | if ($config_database != 'txtsql'){
//////////////////////
//Check the table size and optimize table
$query = "SHOW TABLE STATUS";
$result = mysql_query($query);
$i = 0;
while($row = mysql_fetch_array($result)){
$output[$i] = $row['Data_length'];
$i++;
$wasted = $row['Data_free'];
if ($wasted > 0) {
$query2 = "OPTIMIZE TABLE ".$row['Name'];
$results = mysql_query($query2);
}
}
$size = array('users' => $output[6], 'story' => $output[4] + $output[5], 'comments' => $output[1], 'categories' => $output[0]);
} |
Or get it with the latest CuteNews.RU download.
|
|
| Sun Oct 23, 2005 10:46 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
 |
 |
|