Bug? $db-log() not showing correct query

30 views
Skip to first unread message

Benque Verkoop op Rekening

unread,
Aug 2, 2022, 9:11:29 AM8/2/22
to Fat-Free Framework
Hi Guys,

when i create a parameterized UNION query i use parameters in all UNION parts. The parameters are lettered like :A, :B and so on. So in my example i UNION two queries and both have 6 parameters. From :A until :F. When i run the query, using $db->exec(), i get the expected results. However when i use $db->log() to see what the query exactly looked like it only shows the first UNION with injected parameters while the second UNION part still displays the :A till :F.

I think the $db->log() is not the final executed query since it won't run like that.

Maybe it's a bug?

Simplified output $db->log()

SELECT SUM(_c) total FROM (
        SELECT
          COUNT(a.id) _c
        FROM
          `t1` a
        WHERE
          `c1` LIKE '%360' OR `c1` LIKE '%360%' OR `c1` LIKE '360%' OR `c2` LIKE '%360%' OR `c3` LIKE '%360' OR `c3` LIKE '%360%' OR `c3` LIKE '360%'
       UNION
        SELECT
          COUNT(a.id) _c
        FROM
          `t2` a
        WHERE
          `c1` LIKE :F0 OR `c1` LIKE :F1 OR `c1` LIKE :F2 OR `c2` LIKE :F3 OR `c3` LIKE :F4 OR `c3` LIKE :F5 OR `c3` LIKE :F6  
      ) b
Reply all
Reply to author
Forward
0 new messages