i want to INSERT into db through external file log.php. id , date set in mysql DATETIME, and two strings. My function call is zapis_log($surename);
.
I'm getting error at prepare
, and while executing
.
log.php
<?php
require 'connect_test.php';
function zapis_log($who) {
$action = "edit";
$log = $conn->prepare("INSERT INTO log (id,date,action,who) VALUES(NULL,NOW(),'$action','$who')");
$insert = $log->execute();
}
?>
Thank you guys.