Questions tagged as 'mysql'

2
answers

Define the first letter of the $ variable in capital [duplicate]

I'm using MYSQL to show some data on my site ... But some data is in lowercase, and I need the first letter to be in Capital. But I do not know how to do this using variable ... I need the data of my variable "$name" to be with the f...
asked by 26.04.2018 / 00:21
3
answers

I can not convert seconds to minutes

I'm doing the following query: SELECT SEC_TO_TIME(sum(Total_Segundos_Consumidos)/count(distinct IDTRANSACTIONS)) AS 'Tempo Médio' FROM (SELECT IDTRANSACTIONS, SUM(TIME_TO_SEC(TimeDiff(TIME_FORMAT(DATEFIM,'%H:%i'),...
asked by 04.09.2018 / 15:03
1
answer

How to query MYSQL in 2 columns and sort 1st results of column title and then column description

I am setting up a job agency website and I have a search that looks in the field title and description, what the person searched, as per the query below: SELECT * FROM vagas WHERE (titulo LIKE '%termo_de_busca%' OR observacoes LIKE '%termo_de_...
asked by 31.08.2018 / 14:33
1
answer

How to work with base64 encryption in MySQL?

I need to work with encryption in MySQL and I need to use base64 because I hear that MD5 has a small failure that allows you to have two different passwords with the same MD5. I need to encrypt and decrypt. insert into scl_usuario (logi...
asked by 16.12.2014 / 18:44
2
answers

MySQL query using JOIN

Hello! I have the following database: I would like to make an appointment where I can search for example the teacher x that is related to the student y and z but not the student w. However when executing my queries it displays the teach...
asked by 22.11.2018 / 15:01
3
answers

Pick up the name of the record in the most repeating column

I need to have the most repeated record appear in the tipo_doenca column from the localidade column, which is to display the disease that is in the greatest amount in that location. Table name: TB_grafico     
asked by 14.05.2018 / 18:39
2
answers

To do a complex search would I have to use OR to combine all instructions?

I would like a help to make the SQL according to the data of this figure. What I know is that if I send AND to all characteristics and one of them returns false or erro all SQL is compromised. I thought about doing thi...
asked by 06.10.2014 / 18:41
2
answers

Why this SQL syntax error?

$termos = (explode('/', implode('/', $_GET['tipo']))); print_r($termos); Array ( [0] => CASA [1] => CASA EM CONDOMINIO [2] => COBERTURA ) I'm having a syntax error in this SQL that makes loops to add as many terms as need...
asked by 04.10.2014 / 18:03
1
answer

How to do foreign table associate fields using select? [duplicate]

In my project I have a function in which I search all elements of the database and still causes "categoria_id" to become "categoria_nome" requesting the field in another table, however when I try to use this select I again...
asked by 18.08.2017 / 03:10
2
answers

How to import data from bank to form field

I have a course management system where the user has access to a table with all classes of all courses and chooses to enroll in one. When the user is going to register, he / she will open a form with the fields that he / she must fill out and...
asked by 25.08.2017 / 15:31