I am wondering if anyone knows of a way to post information about the database on the site. What I am looking for is the php code to display the information below.

For example:

1) This 'tableXX' in 'databaseXX' has XXX rows.

2) This 'tableXX' was last updated on 'DATE' and 'TIME'

Any help would be appreciated

Recommended Answers

All 7 Replies

There is no mystery to this. The info is available in the MySQL manual and partially in the PHP manual.

To get the number of rows use the php mysql_num_rows command.
For the info on the date and time of last update do a mysq_query with the "show table status" command

Thank you guys. I am learning and I appreciate your help. Sometimes the challenge is to know what to even call your search in Google.

I got #1 of my question to work, but I am still struggling with #2.

I have tried many things but here is what I have now. Database is called playerdb and the table I want to show data from is also called playerdb.

<? php
$result2 = mysql_query("SELECT UPDATE_TIME FROM playerdb AND TABLE_NAME = 'playerdb'");


echo "Last updated on : $result2";


?>

I appreciate any help.
Cheers

Thank you guys. I am learning and I appreciate your help. Sometimes the challenge is to know what to even call your search in Google.

I got #1 of my question to work, but I am still struggling with #2.

I have tried many things but here is what I have now. Database is called playerdb and the table I want to show data from is also called playerdb.

<? php
$result2 = mysql_query("SELECT UPDATE_TIME FROM playerdb AND TABLE_NAME = 'playerdb'");


echo "Last updated on : $result2";


?>

I appreciate any help.
Cheers

You need to add column in your table that will store last update time that will be modified each time the row get modified

Thanks evstevemd. I have tried that and when I echo that column - I get all 0's in my output. What am I missing?

Anyone have any ideas as to why it is all zeros?

Thanks Hielo for solving this in another thread!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.