Questions tagged as 'mysql'

1
answer

How to put the data of a while inside a variable?

This code returns several values for the database: while($TiV = $frm_interesse->fetch()){ echo $TiV['CODIGO']; } ... and I need to send these values via email with PHPMailer . I need some help to get to the following resu...
asked by 17.11.2014 / 00:24
1
answer

Count database records without repeating

I have a table that has several records with the same information, eg: id | nome | profissao 1 Carlos Pedreiro 2 Jean Garçon 3 Victor Pedreiro 4 Ana Paula Secretaria 5 Paula Secretaria 6...
asked by 31.07.2018 / 15:18
1
answer

remove repeated data in mysql

I have the following table named cadastro : cod | name | age With the data: COD NOME IDADE 2 | rafael | 15 3 | bruno | 17 4 | rafael | 33 5 | sabrina | 18 6 | bruno | 15 7 | paulo | 15...
asked by 30.07.2018 / 16:53
1
answer

Query using WHERE

I need to query in a table called controls: I have the column CH which is the hourly load in minutes and I have the column SETOR which are the sectors that participated in some training. I need to make an appointment wh...
asked by 21.08.2018 / 15:37
1
answer

Query error when using 1 where and 2 joins in Query Search

Hello, I'm running the following query in mysql: select * from usuarios where login='gamboamurilo' or email='[email protected]' and senha='8b0a60f71e758c8b27e7688ee754cd85' inner join permissoes on usuarios.permissoes=permissoes.id inne...
asked by 17.09.2018 / 02:01
2
answers

mysqli_prepare () expects exactly 2 parameters, 1 given

Hello, I'm developing a local system here for the store where I work and I have the following title problem when importing data to the bank. Here are the codes: User Class <?php class Usuario { private $id; private $nome;...
asked by 29.08.2018 / 21:04
1
answer

How to perform a bind_param () with SELECT UNION ALL

I have this code. <?php $link = new mysqli("localhost","root", "SENHAAAA", "BANCO"); $sql_saldo_total = $link->prepare( "SELECT sum(g) saldo_total FROM ( SELECT SUM(valor_pg) g FROM tabela1 WHERE departament...
asked by 05.07.2017 / 23:07
1
answer

PHP script to count comma-separated records [duplicate]

In the database I have a column that receives strings in this format: ["87", "12", "67"] What I need is to count each value separated by a comma and assign it to some variable, remembering that there are more rows. In this case I would have...
asked by 04.10.2018 / 22:42
1
answer

SQL To Count If It Is Greater Than 1

My problem is this: I have to make a condition if the SEQ_VENDA has more than 001 NUMBER, it bring the SELECT data. And if you have only 1 NUMBER referring to SEQ_VENDA do not bring in SQL     
asked by 23.10.2018 / 15:09
2
answers

When inserting the result of a query, inserting only the first row

I'm bringing a query from one bank and I'm going to insert it into another one, this is running the question and it's only inserting the first line and not all the results, see my script below: <?php $host="192.168.0.249"; $por...
asked by 20.09.2016 / 17:35