KalashaLv Posted August 21, 2018 Report Share 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") Quote Link to comment Share on other sites More sharing options...
Val Posted August 21, 2018 Report Share Posted August 21, 2018 Kas ir c.id? Quote Link to comment Share on other sites More sharing options...
KalashaLv Posted August 21, 2018 Author Report Share Posted August 21, 2018 (edited) category id. (bij jābūt FROM posts p, topics t, category c) Edited August 21, 2018 by KalashaLv Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.