Re: clear a mysql table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2008-10-25 at 20:47 -0500, Micah Gersten wrote:
> 
> Ronald Wiplinger (Lists) wrote:
> > I need to clear a table (cache) from a database based on the database size.
> >
> > Our web site uses cached pages. Our webhost only allow us 100 MB
> > storage. Usually the database is just 10 MB, but when a search engine
> > crawls our calendar, then the storage is quickly 108 MB. The system
> > reports then mathematically correct: Space left on database -8MB !!!
> >
> > I plan therefore a web page, which is triggered by cron every hour and
> > will just clear the table.
> >
> > Can I use just:
> > mysql_query("DELETE FROM cash")
> > or die(mysql_error());
> >
> >
> > or do I need to loop through all records? or is there a better solution?
> >
> > How can I get the database size?
> >
> > bye
> >
> > R.
> >
> >   
> Perhaps you should not have search engines index your calendar.
> 
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
> 
> 
Yeah, you seem to be trying to treat the effect rather than the cause,
which will more than likely have other problems down the road. Are you
sure you need to cache calendar pages too? I mean, if you look at the
web stats for your site, is it really benefiting from caching in the
calendar section?


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux