0

I'm trying to find a way which php/js script is accessing certain database table I researched a lot but can't find any solution.

what I want to do is something like list all scripts(especially php) that access/uses specific database table

ex. MySQL TableA (target table)

list all scripts that access TableA

  • scriptA.php
  • scriptB.php
  • scriptC.php

etc.

how can I do this in real time? if not possible output the list in a log file or some file that I can list?

if there is no way how would you suggest to track the scripts that accesses TableA?

ha_ryu
  • 568
  • 2
  • 7
  • 20
  • 1
    yes, by editing the scripts in question, im guessing you dont want that –  Apr 10 '18 at 02:13
  • The simplest way would be to search through your source code for references to `TableA`. You could turn on the [mysql general log](https://stackoverflow.com/a/6479183/2624391) but that will only tell you the queries being executed, not the script sending the query. – Tim Apr 10 '18 at 02:15
  • @Tim then one might create several different users and the answer would be immediate. – zerkms Apr 10 '18 at 02:16
  • How about maintaining a separate table? Something like : when scriptA access table1, you can put a recode on that separate tabale. Then you can fetch em in real time by using webSockets or ajax. – Varuna Apr 10 '18 at 02:22

0 Answers0