Find out when a table was updated Without a Query!!!

Discussion in 'MySQL' started by ched, Apr 3, 2010.

  1. #1
    I am trying to find out if its possible to use php to find out when a table was last updated. But I would ideally like to do it without querying the database!!!!!

    I was thinking of using filemtime but the Database is on a shared server and I dont have access to the '/var/lib/mysql' file location.

    Any ideas?
     
    ched, Apr 3, 2010 IP
  2. absorbation

    absorbation Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It would typically be impossible without you having to access the database in some fashion. Can I ask why you need to check when a table was last updated and the problem in querying the table? :)
     
    absorbation, Apr 4, 2010 IP
  3. ched

    ched Active Member

    Messages:
    185
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Cheers for the reply absorbation. I was trying to minimise database queries as I am on a shared host and I am getting a reasonable amount of traffic and I am starting to get too many concurrent connections. That is causing users to get errors. So I am trying to really minimise querys. Also I am going to be increasing the number of dynamic sites I have on the host so the problem will only get worse.
    So I am effectively creating a cache copy of my dynamic pages. So when a page is opened on my site the code checks the cached pages update time and then ideally checks the table update time and if necessary creates a new cache page if not it uses the existing cache copy page. I know its crude but it does cut down queries a lot.
    At the moment I have just used a dummy file and recreate it when any data is added to the database.
    It works but I always like to try and learn new things as I know my knowledge is not as good as it should be :)
     
    ched, Apr 4, 2010 IP