--- a/heuristics/heuristics.inc.php +++ b/heuristics/heuristics.inc.php @@ -10,8 +10,8 @@ { // check if already ran $query = "select count(*) from heuristic_results where heuristic_name = '$heuristicName' and CNID = '{$cn['CNID']}'"; - $result = mysql_query($query); - $r = mysql_fetch_array($result); + $result = $conn->query($query); + $r = $result->fetch(PDO::FETCH_BOTH); if ($r[0] == 0) { // if not, run now $hresults = call_user_func($heuristicName, $cn); @@ -31,9 +31,10 @@ '{$cn["supplierID"]}' )"; // save value and cn data via sql - $result = mysql_query($query); - if ($result) echo "Saved $heuristicName for {$cn["CNID"]}
\n"; - elseif (strpos(mysql_error() , "Duplicate entry") === false) echo $hresults . " failed insert.
" . mysql_error() . "
$query

\n"; + $result = $conn->query($query); + $errors = $conn->errorInfo(); + if ($errors[2] == "") echo "Saved $heuristicName for {$cn["CNID"]}
\n"; + elseif (strpos($errors[2] , "Duplicate entry") === false) echo $hresults . " failed insert.
" . print_r($errors,true) . "
$query

\n"; } } ?>