I have a function:
function report_error($db, $uid, $companyid, $function, $input, $error ){
try {
$submit = new PDO("mysql:host=".$db['server'].";dbname=".$db['db'], $db['mysql_login'], $db['mysql_pass'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
$submit->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt=$submit->prepare ("INSERT INTO error_log (companyid, uid, funct, input, error, datetime) VALUES (:companyid, :uid, :function, :input, :error, NOW());");
$stmt->bindParam(":uid", $uid);
$stmt->bindParam(":input", $input);
$stmt->bindParam(":companyid", $companyid);
$stmt->bindParam(":error", $error);
$stmt->bindParam(":function", $function);
$stmt->execute();
}
catch(PDOException $e) {
echo "error: ".$e->getMessage();
//report_error ($db, $uid, $companyid, "report_error", $e->getMessage());
}
}
When i call the function:
report_error ($db, $_SESSION['uid'], $companyid, "update_company_rate", "car_category: $car_category, rate: $rate, companyid: $companyid", $error);
Nothing happens: no error msgs, no warnings in http logs, nothing. The query itself works fine, whenever I run it with navicat or other SQL-client.
I had been working on this one for 3 hours and can't think straight anymore, please see what is wrong in here.