Answer the question
In order to leave comments, you need to log in
How to build a query in sql c count?
Help me to do, in general, there is a page with a key, there is a database in which there are three tables (connected id), one of them with a list of books, it has books with and without authors, how can I build a query to display books without authors with using count?
<?php
$g=$mysqli->query("SELECT COUNT(b_name) FROM books");
$result=[];
while($b=mysqli_fetch_assoc($g)){
$result[]=$b;
}
var_dump($result);
Answer the question
In order to leave comments, you need to log in
In your screenshot, only ID AND b_name are visible. Is there an author column at all?
if there is, then
select * from books where author is null
should return all books where there is no author (author is the name of the column with the author)
With count you will display a number, not a book.
And in general esteem about where.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question