I've been having trouble inserting
data by calling it from a specific function. It's give me no errors but it just doesn't insert.
Here is the code
function log_($moderator, $actions, $conn)
{
try
{
$log = $conn->prepare("INSERT INTO moderation-history(moderator, action, date, ip_addr) VALUES (:Moderator, :Action, ".time().", ".$_SERVER['REMOTE_ADDR'].")");
$log->bindParam(':Moderator', $moderator, PDO::PARAM_STR, 100);
$log->bindParam(':Action', $actions, PDO::PARAM_STR, 100);
$log->execute();
}
catch(PDOException $e)
{
error_log("PDOException: " . $e->getMessage());
}
}
and the code for it to execute once the Moderator changes the permissions
log_($user, "Altered ".$username." Permissions", $conn);
Executing this function should insert the data. As $user = Moderator, 2nd = Action, $conn = DB Connection.