1 (edited by Smartys 2005-05-07 22:10)

Topic: Make database stats "more accurate"

Dunno exactly how this ports over to anything other then MySQL, but I'll suggest it anyway smile

Current code:

$result = $db->query('SHOW TABLE STATUS FROM `'.$db_name.'`') or error('Unable to fetch table status', __FILE__, __LINE__, $db->error());

My suggestion

$result = $db->query('SHOW TABLE STATUS FROM `'.$db_name.'` LIKE "'.$db_prefix.'%"') or error('Unable to fetch table status', __FILE__, __LINE__, $db->error());

That way, if there is a prefix, we only fetch the stats for the board we're looking at. smile

Oh, I forgot to say why this is good tongue
It helps people running multiple things from one database (be it multiple PunBB installs or anything) see how much space PunBB is actually taking up. I know I have a CVS version of PHPBB 3.0 in the database with PunBB, and it threw my stats off a lot tongue

Re: Make database stats "more accurate"

Good idea.

"Programming is like sex: one mistake and you have to support it for the rest of your life."