[beginner question] Run php script without changing page

Hi, I’m hoping to find out how to run a php script from something similar to a link clicking but not actually changing page location. So for example (in my crazy world where this is possible):

<a href=“random.php”>random</a>

clicking that would not go to random.php and render it as an html page but merely run the php code held within it (akin to calling a function) for example to edit a row in a mysql table.

I hope this hasn’t come across too idiotic, i’m a flash/java/css/html man mainly!!