Jump to content
MakeWebGames

[mccode] Optimize Tables once an hour.


Ragnar
 Share

Recommended Posts

Just adding one line can do this! Get a list of all your tables. Then in cron_hour.php

replace

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

with

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

with the tables listed being all of the ones you got. (Don't copy this, or you'll probably get an error for unknown tables, and miss tables you got that arn't listed.)

Change

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

to

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

if you're using v1.

Added code tags -- Tezza`

Link to comment
Share on other sites

Re: [V1 and V2] Optimize Tables once an hour.

I indeed do this task now and again when I remember via the phpmyadmin however this is I suppose something else that saves you messing around having to do it. Me personally wouldnt have it every 1 hour. Maybe once a day or week but 1 hour seems excessive. I think its down to preferences but I doubt really 1 hour of game progress would mess up the tables that much that it would require to be optimized.

Link to comment
Share on other sites

Re: [V1 and V2] Optimize Tables once an hour.

You can easily put it in the day cron.

I decided to put it in the crons cause after just a week of releasing the game, I started geting some weird errors....then finally got something like

Can't open file: 'users.MYD'. (errno: 145

which could only be fixed by repairing it. If it's optimized every hour, odds are, it'll never get to where tables have to be repaired.

Just 30 minutes after the cron did it, I did it in phpMyAdmin, and nine tables spit out 'OK' instead of 'Table is already up to date.'

Link to comment
Share on other sites

  • 1 month later...

Re: [V1 and V2] Optimize Tables once an hour.

 

what exactly does this do?

From what i read, it simply fixes tables every time the cron runs, although when i do something to a cron, it goes weird :( and the cron stops working or that particular cron doesn't work

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...