Its very simple to do with php/mysql. I am not experienced with either and I was still able to code my own script from scratch. Here's a step by step to doing it with adwords:
1. Make the url you send visitors to www.yourdomain.com/index.php?kw={keyword}
2. Add this code to your index.php:
<?php
$db_host = "localhost";
$db_user = "your_database_username";
$db_pw = "your_database_password";
$db_name = "your_database_name";
mysql_connect($db_host, $db_user, $db_pw);
mysql_select_db($db_name);
$keyword=$_GET["kw"];
mysql_query("INSERT INTO 'your_database_table' ('keyword') VALUES ('$keyword')");
?>
I'm going from memory but I'm pretty sure that's how it's done. I've never done it with yahoo or microsoft ppc, but all you'd need to change is the {keyword} in the url to whatever variables they use.