Questions tagged as 'mysql'

1
answer

SQL SERVER Filter

I have an exercise to do but I'm breaking my head here: "SQL command that brings me the sum of the salaries received by employee and state in the year 2014 of the tables: SALARIES / COLLABORATORS / LOCAL_DE_TRABALHO". I have already create...
asked by 02.07.2018 / 01:40
2
answers

Insert with PDO and INNER JOIN

I have a person table that has the name, city, and phone fields and time_id. I also have another table with a team name and in it I have a field called my_time, how can I make an INNER JOIN to register the team in that time table but in the pers...
asked by 29.06.2018 / 12:59
1
answer

Login Levels

How can I make it just show the user that they have $cargo == 'Administrador' ? I have seen many being used with number, but I want to leave it registered with the name Administrator or Visitor and thus in the menu, to be able to be sho...
asked by 11.07.2018 / 23:43
1
answer

Join tables MySQL

I have a table that has the times of the day SELECT * FROM horas ColumntypehoraisVARCHAR(5)AndaquerycontainingthetimevaluesSELECTDATE_FORMAT(date,'%H:%i')HORA,TRUNCATE(MAX(humidade),2)MAX_HUMIDADE,TRUNCATE(MIN(humidade),2)MIN_HUMIDADEF...
asked by 24.07.2018 / 20:20
1
answer

Filter with select in php

I have this code with the 3 selects to filter a query: <form class="shadowbox6" action="" method="post"> <strong><label for="Estado Encomenda">Estado Encomenda</label></strong> <select name="pesquis...
asked by 27.07.2018 / 15:42
1
answer

LIKE with COUNT in PHP

I can not understand what's wrong with the code: $query="SELECT aluno FROM bonesmirn2 WHERE data LIKE '%2018-09%' AS faltas GROUP BY aluno HAVING COUNT(aluno) > 0 ORDER BY COUNT(aluno) DESC"; $result = mysqli_query($dbcon, $query); $numb...
asked by 04.09.2018 / 08:43
1
answer

Add open installments with Join

I have two tables, Cliente and Parcela . The Parcela table has id do cliente as foreign key, a pagamento column that is null or contains the payment date in date format and a valor column th...
asked by 04.09.2018 / 15:19
1
answer

Updating multiple lines and fields of Mysql

I set up a MySQL Query with the purpose of updating a multi-line field of my Mysql table. It was as follows: update produtos set (nome) = case codigo when 5 then 'teste 1' when 6 then 'teste 2' when 7 then 'teste 3' where codigo in (5,6,7)...
asked by 20.03.2018 / 15:35
2
answers

How to do two Select

I want to select the amount of like and deslike of each post but I'm not getting the deslike, can anyone help me?     
asked by 20.03.2018 / 02:32
2
answers

Unrecognized keyword "as"

I'm using MYSQL together with PHPMyAdmin 4.7.4, and he accuses the 'as' keyword is not recognizable, but when running it it goes in infinite loop, and does not show any results. SELECT c.'nome', case c.'id_estado' when c.'...
asked by 16.05.2018 / 07:33