Questions tagged as 'mysql'

3
answers

what is the best way to make a query case_sensitive

SELECT * FROM 'table_users' WHERE BINARY nome = $nome AND senha = $senha Is this correct, or is it bad practice?     
asked by 01.03.2018 / 03:49
2
answers

Query with inner join

I need to check if a data in table1 is represented in table2 Na tabela1 ID | NOME | PARCELAS | DATA | NF Na tabela2 ID | VALOR | PARCELA | VENCIMENTO | NF    SQL Query with INNER JOIN I may be mistakenly wanting to...
asked by 20.02.2018 / 15:59
2
answers

Query mysql return 4 counts same table

I would like to do a select in the same table that contains 4 different values, all with clauses, I'm trying the following way but I'm not getting it, I want each count to be done in a STATUS where I specify there, but it is not returning me noth...
asked by 20.02.2018 / 14:18
1
answer

What is the best way to make post comments?

How can I organize a comment system in MySQL An idea would be: id_post id_comentario id_user comentario But it would take up a lot of space and it would not be so quick to process 2000 comments from id_post different I also tho...
asked by 25.02.2018 / 17:26
1
answer

SQL WHERE returns unwanted values

SELECT x, y, z, f , g , h FROM torrents INNER JOIN w ON w = x WHERE y = '2' OR y = '7' AND f = '1' AND h < 4294967296 I set the f = '1' in where so that it returns only the values with f = 1 so it returns values wi...
asked by 18.02.2018 / 03:25
2
answers

Prioritize row in sql queries

In a Results with 2 fields exactly alike, how to do that only show lines that the priority column is marked as 1 id | origem | destino | daia_inicio | data_fim | valor | prioridade 01 | Galeão | Barra | 01/01/2018 | 31/...
asked by 12.02.2018 / 16:10
1
answer

Inner Join with Where and multiple tables

I'm setting up a query, where I need to join between two tables (since the data will be in the main B but not in the BC complement) and a third table that I need the data, which will always be in the main table B. I tried as below, but return...
asked by 05.11.2018 / 20:53
3
answers

Send data to the database according to the select tag via PHP [closed]

I am making a form to send some data to the bank, to expedite a process, my question is the following, I have 5 systems that I need to update, so I made a select in html. Home I need to send each option of select to a differ...
asked by 06.11.2018 / 14:17
1
answer

MySQL: Limit record recording based on value from another table

I have a A table with a start_date field and another end_date . I have a B table with a date field. Is there any way to ensure that a record is only saved in B when B.date is between A.start_date...
asked by 27.03.2018 / 20:21
1
answer

Best Mysql Type to count accesses

I have a database containing PDF files, but I'm trying to count how many views this file had. The accounting structure is ready because it was done in PHP / Mysql, but I have a question. I usually put Type Varchar (255), but for this type is it...
asked by 22.03.2018 / 15:20