Questions tagged as 'mysql'

1
answer

Select with Inner join too slow

I have a problem where select is bringing the right result, but it takes too long. Follow the select: SELECT c.cod_paciente, p.nome, i.valor, i.quantidade, d.convenio, c.cod_conta FROM caddadosclinico d INNER...
asked by 05.01.2018 / 20:26
1
answer

Send email to client to check whether or not [duplicate]

I made a registration to be inserted the cpf and email, the cpf I could validate right, to see if it works or not. But when it comes to the part of knowing if the email exists ... I researched a lot and saw a way, which is to send an email to...
asked by 28.11.2017 / 17:35
2
answers

List Tree Categories in Laravel 5.1

I'm starting with Laravel 5.1 and I'm a bit lost yet. I need to list categories, subcategories and "sub-subcategories". Table: Categorias ------------------------ id | int nome | varchar categoria_pai | int Data:...
asked by 11.08.2015 / 19:53
2
answers

How to make an INNER JOIN between two different banks on the same server in MYSQL?

I would like to make a INNER JOIN between two distinct tables that are on the same server. Was it something like that? INNER JOIN BANCOA.tabelaA.colunaA ON BANCOA.tabelaA.colunaA = BANCOB.tabelaB.colunaB Remembering that I'm doing th...
asked by 13.10.2017 / 16:29
3
answers

Socket error in MySQL installation

I am not able to uninstall and run MySql 5.5 on my Ubuntu Linux 14.04.LTS, every time I try to access it, I get the following message:    ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'...
asked by 10.08.2015 / 20:21
2
answers

mysqli_select_db () expects parameter 1 to be mysqli, string given [duplicate]

I have a problem here with Mysql, it is giving errors, I have made all kinds of changes. I have tried to change the Mysql function to Mysqli and only increase errors. Code: <?php $sql["host"] = "localhost"; $sql["usuario"] = "ro...
asked by 29.10.2017 / 14:41
1
answer

How to make a query in sql that returns the data of a table when the data is empty? [duplicate]

Well, I created a table called installments, which when the customer pays it is entered 'PAYMENT' in the column situation, and when not paid it remains blank. I wanted to get the information from this column to know when the account was not pa...
asked by 29.10.2017 / 16:09
1
answer

# 1264 - Out of range value for column 'year' at row 1

Query : INSERT INTO veiculo(nome,modelo,placa,ano) VALUES('teste','testeModel','ASD5647',2012) Fields: nome | varchar modelo | varchar placa | varchar ano | int Error reported:    # 1264 - Out of range value for column 'yea...
asked by 20.10.2017 / 17:45
1
answer

Select grouping by average per hour and sum per day

How can I return a select the daily sum of the value column, being that before adding I have to do an average per hour? My table receives the "value" once per second, I need to average the hourly value of that value and return the sum of these a...
asked by 26.10.2017 / 23:56
2
answers

Try / Catch PDOException does not work when error occurs

I created the following method to execute my querys: public function setQuery($query) { try { $stmt = self::$conn->prepare($this->limpaQuery($query)); return $stmt->execute(); } catch (PDOException $Exception)...
asked by 12.11.2017 / 01:03