0

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

4
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by ceeandcee
0

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

0

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

0

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

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.