Topic: No answer possible to a peculiar post

Hello,
Since this morning, it has become impossible to answer to own of the topic. Cannot show you, it is in the private part of the forum.

Error message says :

Désolé ! La page ne peut être chargée.
Cette erreur peut être temporaire. Actualisez la page. Si le problème persiste, essayez à nouveau dans 5-10 minutes.
Le serveur BDD a répondu: near "AND": syntax error (Errno: 1).
Impossible d'exécuter la requête : SELECT u.id, u.email, u.notify_with_post, u.language FROM dbtusers AS u INNER JOIN dbtsubscriptions AS s ON u.id=s.user_id LEFT JOIN dbtforum_perms AS fp ON (fp.forum_id=34 AND fp.group_id=u.group_id) LEFT JOIN dbtonline AS o ON u.id=o.user_id LEFT JOIN dbtbans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)> AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id=84 AND u.id!=2
Une erreur est apparue à la ligne 2725 dans le fichier /var/www/lXXX/www/include/functions.php

Where should I look ? Is the data based damaged ?

http://revest.legtux.org/t
PunBB 1.4.4
    Système d’exploitation: Linux
    PHP: 5.6.29-0+deb8u1
    Accélerateur: Sans objet

Base de données
    SQLite3 3.8.7.1

https://agora.chauvigne.info/
PunBB 1.4.6
PHP: 8.0.24
Base de données    SQLite3 3.27.2

Re: No answer possible to a peculiar post

COALESCE(o.logged, u.last_visit)> AND

$previous_post_time --> null or false in code

// Send out subscription emails
function send_subscriptions($post_info, $new_pid)
{
...
    // Get the post time for the previous post in this topic
    $query = array(
        'SELECT'    => 'p.posted',
        'FROM'        => 'posts AS p',
        'WHERE'        => 'p.topic_id='.$post_info['topic_id'],
        'ORDER BY'    => 'p.id DESC',
        'LIMIT'        => '1, 1'
    );

    ($hook = get_hook('fn_send_subscriptions_qr_get_previous_post_time')) ? eval($hook) : null;
    $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
    $previous_post_time = $forum_db->result($result);
ForkBB
I speak only Russian  :P

3 (edited by MaraKat 2017-02-10 08:02)

Re: No answer possible to a peculiar post

Thanks. Difficult to understand, I am no coder, sorry.

Maybe it was because I subscribed to email for forums where there was no message yet.
I will unsubscribe to empty forums and see what happens.

Or because I had subscribed to a topic which was deleted afterwards ?

https://agora.chauvigne.info/
PunBB 1.4.6
PHP: 8.0.24
Base de données    SQLite3 3.27.2

Re: No answer possible to a peculiar post

>Maybe it was because I suscribed to email for forums where there was no message yet.
Very high probability.

It is possible to try such code for correction of a problem:
functions.php file

    $previous_post_time = $forum_db->result($result);

-->

    $previous_post_time = $forum_db->result($result);
    
    if (empty($previous_post_time)) {
        $previous_post_time = 0;
    }
ForkBB
I speak only Russian  :P

Re: No answer possible to a peculiar post

Yes ! Thank you ! That corrected the problem. Many many thanks.

https://agora.chauvigne.info/
PunBB 1.4.6
PHP: 8.0.24
Base de données    SQLite3 3.27.2