KalashaLv Report post Posted August 21, 2018 You. Es dumjš pašlaik esmu un netieku galā ar postu un topiku skaita izvadi. $q = mysqli_query($conn, "SELECT COUNT(p.topic_id) AS post_count FROM posts p, topics t WHERE p.topic_id = t.id AND p.topic_id = c.id"); viņš izvada 0 un ja šādi - $q = mysqli_query($conn, "SELECT COUNT(p.topic_id) AS post_count FROM posts p, topics t WHERE p.topic_id = t.id"); viņš izvada 3 (jo datubāzē ir 1 topiks un 2 posti ar id "23") Share this post Link to post Share on other sites
Val Report post Posted August 21, 2018 Kas ir c.id? Share this post Link to post Share on other sites
KalashaLv Report post Posted August 21, 2018 (edited) category id. (bij jābūt FROM posts p, topics t, category c) Edited August 21, 2018 by KalashaLv Share this post Link to post Share on other sites