-1

I have a MySQL query that inserts the content of a form into my database.

Along side inserting these values, I also want to discover and insert the users IP address.

user3359065
  • 77
  • 1
  • 3
  • 12
  • $_SERVER["REMOTE_ADDR"]; – Steve Apr 24 '14 at 10:09
  • mysql can not figure out the ip address of the client its the server side language which can see from which IP request is coming. – Abhik Chakraborty Apr 24 '14 at 10:10
  • 1
    bt i am using trigger in mysql...and i want to know who is changing the db tables value.. – user3359065 Apr 24 '14 at 10:15
  • to do this either you have to fetch user name and IP which can be obtained from information_schema.processlist. Now here you can always create a before insert trigger but remember triggers are not always useful and can impact DB performance if not implemented according to the requirements – simplifiedDB May 09 '21 at 08:40

1 Answers1

1
<?php echo $_SERVER["REMOTE_ADDR"]; ?>
SagarPPanchal
  • 9,839
  • 6
  • 34
  • 62