guitarist809 Posted March 17, 2007 Share Posted March 17, 2007 Hello, I've new to php's side of mysql and I was wondering if maby somebody could help me The first problem I encountered is how big my database is (in kilobyes or megabytes). I have no idea how to start this one so any help would be useful. My second problem is how many records are in the database and in each table in the database (I don't want to run 20 mysql queries and do a num_rows on them and add them for the entire database. or is this the only way to do it ???) Any help would be greatly appreciated. Sincerely, -Matt Quote Link to comment https://forums.phpfreaks.com/topic/43069-solved-mysql-and-php-questions/ Share on other sites More sharing options...
artacus Posted March 17, 2007 Share Posted March 17, 2007 You'll have to ask more specific questions. If you're worried about size in terms of KB an MB, you don't have anything to worry about. Tell us what you are trying to do for your second question. Quote Link to comment https://forums.phpfreaks.com/topic/43069-solved-mysql-and-php-questions/#findComment-209277 Share on other sites More sharing options...
guitarist809 Posted March 17, 2007 Author Share Posted March 17, 2007 Sorry, I was kinda in a rush when I was writing that. What I'm doing is writing a database statistics page (similar to phpbb's, if you've ever seen it; it's the admin index). It shows the size of the database in megabytes (all tables combined). For example, dbname is 5mb. For the second question, I'm trying to get a total of the amount of records in a database. For example, my database db1 has 5 tables in it. Lets say all the five tables have 5 records in them. I'm trying to get the total of records, so thats all the tables combined, which is 25 in total. I found a cheap way to do it (do a select * from tablename and do mysql_num_rows($result) and just add those for every table, but that's a pain. Is there an easier way of doing that (like mysql_sum_total_records($dbname)))? Thanks, Matt Quote Link to comment https://forums.phpfreaks.com/topic/43069-solved-mysql-and-php-questions/#findComment-209288 Share on other sites More sharing options...
artacus Posted March 17, 2007 Share Posted March 17, 2007 Well you should use SELECT COUNT(*) FROM table, instead of making the db go thru every record. But it sounds like what you really want to do is "SHOW TABLE STATUS" Quote Link to comment https://forums.phpfreaks.com/topic/43069-solved-mysql-and-php-questions/#findComment-209305 Share on other sites More sharing options...
guitarist809 Posted March 17, 2007 Author Share Posted March 17, 2007 Yep, it was table status. Thx for the help Quote Link to comment https://forums.phpfreaks.com/topic/43069-solved-mysql-and-php-questions/#findComment-209488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.