T
T
th1s2018-03-09 18:53:05
PHP
th1s, 2018-03-09 18:53:05

How to count columns with the same values ​​from a table?

How to count columns with the same values ​​from a table?
The column has the same values ​​chat(for example - 2) , how to count the number of these columns and display them in php?

$order = DB::$the->query("SELECT * FROM `sel_orders` where `chat` = '2' ");
$fname1 = $order->fetch(PDO::FETCH_ASSOC);

PS That is, you need to count all the columns in which chat = 2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2018-03-09
@Azperin

mysqli_num_rows

A
Artem Spiridonov, 2018-03-09
@customtema

SELECT count() FROM `sel_orders` where `chat` = '2' ;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question