wapmetal (11-04-10)
Change user, password and user_drpl1 to reflect your Drupal MySQL username, password and database.Code:<?php $db = mysql_connect('localhost','user','password'); if(!$db) echo "cannot connect to the database"; mysql_select_db('user_drpl1'); $result=mysql_query('OPTIMIZE TABLE accesslog,cache,comments,node,users,watchdog;'); echo mysql_error(); ?>
This will optimize the tables accesslog, cache, comments, node, users and watchdog. Feel free to add or remove tables from the query.
Once you have inserted the code, save the file. For the purposes of this example, we'll assume that the file is called optimize.php. Once the file is saved in your folder, you can execute it directly from a browser:
[Only registered and activated users can see links. Click Here To Register...]
If you get a blank page without any errors, this means that the tables have been successfully optimized
You can also set a cron job in order to execute the optimization script at regular intervals. The cron job you set should be similar to this:
php /home/user/public_html/YOURLOGIN/optimize.php
Make sure you don't set the cron to be executed too often. Once a week should be more than enough to keep your tables optimized
here is other way doing it
i like using this way
each page you place your sql commands like
like index.php you place
i like that way as each user past your site or has a look it optimize the table for you. better then adding cron job'sCode:@mysql_query("OPTIMIZE TABLE online") or die(mysql_error()); @mysql_query("OPTIMIZE TABLE user") or die(mysql_error()); @mysql_query("OPTIMIZE TABLE forums") or die(mysql_error()); @mysql_query("OPTIMIZE TABLE status") or die(mysql_error()); @mysql_query("OPTIMIZE TABLE download") or die(mysql_error()); @mysql_query("OPTIMIZE TABLE settings") or die(mysql_error());
Visit: [Only registered and activated users can see links. Click Here To Register...]
Visit: [Only registered and activated users can see links. Click Here To Register...]
_______
SCRIPTS FOR SALE BY SUBZERO
Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
_______
Info & Tips
php.net
w3schools.com
wapmetal (11-04-10)
thanks sub!
i am in mobile now, with click "thanks" tomorrow!
i'm gonna try this bro
com site: [Only registered and activated users can see links. Click Here To Register...]
download site: [Only registered and activated users can see links. Click Here To Register...]
fb: [Only registered and activated users can see links. Click Here To Register...]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks