Questions tagged as 'count'

1
answer

Problem Counting Checkboxes selected. PHP

I have some checkBox which are a query in DB. I need to get the selected fields and then make a division but it is not working. <form action="contas1.php" method="POST"> <div class="form-group">...
asked by 24.10.2015 / 08:58
1
answer

Correct way to return the number of results using CodeIgniter

I wrote 2 possibilities to return the number of results using CodeIgniter, as follows: public function get_num_indicados($id_usuario) { $query = $this->db->query("SELECT count(id_patrocinador) as num FROM usuarios WHERE id_patrocinad...
asked by 04.11.2015 / 23:17
1
answer

Display Results Replied

Good evening, I'm creating an indication system, But the query result does not return users with zero statements Here's my select SELECT c.id, c.nome, funcao, area, count(p.cpf_cli) AS quantidade FROM col c LEFT JOIN...
asked by 05.10.2018 / 03:46
1
answer

Call list + Subscribers and participants per event

I have the following tables: I need to list COMPANIES and REGISTERS IN THE EVENT (which can have more than one talk) and in the same line bring the QTD OF GIFTS by lecture in columns ... Thus I would get a parameter of use per lecture i...
asked by 30.03.2018 / 22:28
0
answers

DataTables count per group

Has anyone managed to do a row count per group with dataTables? Considering this structure: $('#tabela').DataTable({ "lengthChange":false, "pageLength": 500, "filter":true, "responsive":true,...
asked by 23.01.2018 / 19:22
1
answer

Count number of occurrences in a log file

I'm trying to count the number of occurrences of multiple text patterns in a log file. My code is counting all the lines in the file for all text patterns. Where am I going wrong? The log file looks like this:    Feb 1 00:00:02 bridg...
asked by 02.08.2017 / 17:01
1
answer

Select JOIN + AVG () - Doubt with return

I'm solving an exercise but I'm having problems with the return: Question: Write the query that returns the vendor code, the vendor name, the number of products per vendor, and the average price for each vendor, only for vendors that have a...
asked by 10.03.2018 / 13:19
0
answers

SQL-Count for each id

I want to show all records in the student table - name and number - and then in the right column, show the percentage of attendance. Let's see: SELECT nome, numero, ( ( SELECT COUNT(aluno.numero) FROM aluno JOIN aula ON aluno.id_aula_aluno =...
asked by 29.06.2016 / 16:38
1
answer

Show MySQL Query Result with Echo (PHP)

I have a script in PHP and MySQL that has a query responsible for counting how many records (clients) are inserted into one of the tables in my database. However, I need to show the amount of records (clients) in the table with the echo command,...
asked by 25.12.2018 / 18:37
1
answer

Select with users who most sent messages

I'm making a system and I have to know which user sent the most messages. My tables look something like this: User id|nome|sobrenome|email| ... Messages id|uid|nome|email|assunto|msg| ... I just need to know which user sent more...
asked by 12.08.2017 / 21:56