Jump to content

[SOLVED] Mysql (and PHP) Questions.


guitarist809

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/43069-solved-mysql-and-php-questions/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.