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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.