Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
You can write a wrapper function for your queries that inserts the user action in a histories table.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Kohana::log('info', "User $userID ($username) logged in at " . date());
Of course, this writes to a text-based log file rather than a database, but the principal holds good. Nor would you need a framework's implementation, it would be very easy to make your own.
function my_query($query) {
$result = mysql_query($query);
$action = mysql_real_escape_string($query);
$userid = mysql_real_escape_string($_SESSION['userid']);
mysql_query("INSERT INTO history (`action`, `userid`, `updated`) VALUES ('$action', '$userid', NOW())");
return $result;
}
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.