Questions tagged as 'mysql'

0
answers

Generate MySQL dynamic header

I have below a problem that I can not solve. How do I get the header to have the employee's name and below it the revenue that was generated by the date? And how would an HTML table look like these? The first image is a simple query tha...
asked by 30.08.2017 / 20:53
1
answer

How to return 10 in 10 select rows when clicking a button in php [duplicate]

I have a lot of data in a database and I need to display them in php. Since I have for example 100 lines, I will not display them all at one and only time because the page was going to be unstructured. The idea is to display the last 10 lin...
asked by 05.09.2017 / 14:00
0
answers

MYSQL does not start after upgrading version 5.5 to 5.7 on the Centos 6.9 server

I am upgrading Mysql 5.5 to MYSQL 5.7 on the Centos 6 server, but after upgrading the server does not start. I performed the MYSQL 5.5 version removal process to perform upgrade as indicated on various forums. I will deregulate the entire proces...
asked by 05.09.2017 / 14:46
2
answers

Problem with SQL execution through FORM

Code php: if($_REQUEST['alterarStatus']){ $alterarStatus = trataaspas($_REQUEST['alterarStatus']);} if($alterarStatus=="aprovado"){ $SQL = "update ps set StatusTransacao='Aprovado' where Referencia = '52'"; }elseif($alterarStatus=="comp...
asked by 16.09.2017 / 16:32
1
answer

date / time format of now () in mysql

$verificatempo = mysql_query("SELECT * FROM logs WHERE horario <= now() - INTERVAL 10 MINUTE AND ip = '$ipaddress' ORDER BY horario desc limit 1"); I'd like to know the date and time format identical to the now () that was used in the mys...
asked by 29.08.2017 / 20:59
1
answer

SQL Invalid Identifier Error (INNER JOIN) [duplicate]

Select a list of employees who switched from office to department (% with%), the list should contain the registration and name of the employee, the name of the department and position that worked, and also the start and end date ( job_hist...
asked by 29.08.2017 / 23:34
1
answer

How to make a join of 2 tables and where 2 fields of table A refer to the same field as table B?

I have the SQL command that does not work: SELECT GAT_requisicao.id_GATrequisicao as 'ID Requisição', GAP_atendimento.id_GAPatendimento as 'ID Atendimento', GR_paciente.nome_GRpaciente as 'Nome Paciente', GR_setor.nome_GRseto...
asked by 30.08.2017 / 16:10
1
answer

Date back in mysql

Good morning everyone! how do I, in a query in mysql catch dynamically generate the date referring to 3 months ago?     
asked by 28.08.2017 / 15:55
1
answer

Error "This type of clause was previously parsed. (near "UPDATE" at position 55) "

Hello, I'm updating some information from a database, in which I have to update several, using: UPDATE item SET item_mapa = '2' WHERE item_id = '263' UPDATE item SET item_mapa = '2' WHERE item_id = '264' UPDATE item SET item_mapa = '2' WHERE it...
asked by 28.08.2017 / 15:55
1
answer

How to give select between one hour_minute and another in SQL

I need to resolve a simple exercise requesting to report the amount of books sold between 1:00 pm and 5:30 pm on all dates. I was able to pull between 13h and 17h but not with the "17h30" minutes. I did so: SELECT SUM(quantidade) FROM n...
asked by 10.09.2017 / 06:06