I’ve just read several manual pages and forum comments on "Error number 1064" but I still don’t understand what’s going on with the problem I'm having now … Also, I'm surprised that the error message mentions two different line numbers (1 and 35). Here is the error message I get :
And here are the contents of my "one_more_visit_to_topic.php" file :
<?php
include("includes/model/database_searches/see_readings.php");
include("includes/model/database_searches/see_watchings.php");
function one_more_visit_to_topic($user_id,$topic_id)
{
global $db;
$request_string='UPDATE forum_topic '.
'SET topic_vu = topic_vu + 1 WHERE topic_id = :topic';
$query=$db->prepare($request_string);
$query->bindValue(':topic',$topic_id,PDO::PARAM_INT);
$query->execute();
$query->CloseCursor();
// Remember that topic has been read by user
if(!(see_if_user_has_read_topic($user_id,$topic_id))) {
$request_string='INSERT INTO forum_read (fr_topic_id,fr_user_id) '.
'VALUES (:topic,:user)';
$query=$db->prepare($request_string);
$query->bindValue(':topic',$topic_id,PDO::PARAM_INT);
$query->bindValue(':user',$user_id,PDO::PARAM_INT);
$query->execute();
$query->CloseCursor();
}
// If user has already received a warning by mail,
// the "alert" value needs to be toggled in the fw_watch table
if(see_if_user_has_been_warned($user_id,$topic_id)) {
$request_string='UPDATE forum_read SET fw_alert = :alt '.
'WHERE fw_topic_id = :topic AND fw_user_id= :user)';
$query=$db->prepare($request_string);
$query->bindValue(':topic',$topic_id,PDO::PARAM_INT);
$query->bindValue(':user',$user_id,PDO::PARAM_INT);
$one=(int)1;
$query->bindValue(':alt',$one,PDO::PARAM_INT);
$query->execute();
$query->CloseCursor();
}
return;
}
?>