Questions tagged as 'mysql'

1
answer

Query in MySQL with undesirable items - PHP

I need to compare two arrays that come back from MySQL, but one of them is coming back with several strange items, making my comparison impossible. I have already filtered the search to return only the field I want, but there is no way ... Ta...
asked by 25.11.2014 / 04:07
1
answer

Select to sort by hour [closed]

Good afternoon Personal, I need to do a select that organizes by date and time. By date is already working, however if I put an "and" "time" after the date, it messes up all the records. See my select: $dados = Connection::select("Select *,id...
asked by 19.02.2016 / 19:01
1
answer

How do I make a query to return the value of another table? [duplicate]

Table PRODUTOS id productname product category valordoproduto Table CATEGORIAS id classname In my form I show the name of the category but register in the database in the table PRODUTOS the id of the...
asked by 19.11.2014 / 23:49
1
answer

Select products in a range of discounted values?

I'm trying to make a filter for values for a virtual store, I have a product table, one for stock and one for promotions.    Products CREATE TABLE 'produtos' ( 'id' INT(11) NOT NULL AUTO_INCREMENT, 'codigo' VARCHAR(255) NULL DEFAUL...
asked by 17.11.2014 / 13:07
2
answers

Display grouped data

I am doing a query in the database and am having difficulties with data duplication, so far, this is my query: SELECT * FROM tec_postagens tp INNER JOIN tec_historico_status th ON tp.protocolo=th.protocolo WHERE tp.protocolo = '1168' ORDER BY...
asked by 12.11.2014 / 13:50
1
answer

Get values from only one row of a table

Hello, I have a project, and I would like it, when the user entered your account, could, through a PHP action, see your basic data, taking only values from that table, here is what I have so far: p> $selec = "SELECT * FROM usuarios"; $selec_que...
asked by 12.11.2015 / 12:50
2
answers

How to query with where and like between two tables?

I have the following problem: I have two tables, the following tables: tabela mensagens +----+-------------------+-------+---------------------+ | id | mensagem | _de | hora | +----+-------------------+-------+----...
asked by 05.12.2015 / 00:50
3
answers

How to create an array with object from an SQL query

I need the following result inside a variable from a query PHP + MySQL : array(1) { [0] => object(stdClass) #1 (3) { ["id"]= > string(2) "1" ["nome"] => string(5) "teste" ["email"] => string(18) "contato@teste...
asked by 25.11.2015 / 21:48
1
answer

I need to put a left join to more in this query

My code is below it returns me "h.banco as the bank" with a number, which is foreign key I want it to return the description of this bank, but in many cases, the bank returns me as null How do I mount the from clause to this? I tried t...
asked by 11.11.2015 / 15:42
1
answer

MySQL returns NULL when it places SUM with no records

I have the code SQL    SELECT sum (r.quantidade_domingo) AS quantity_domingo FROM reports   AS r INNER JOIN nodes AS n ON r.id_nucleo = n.id INNER JOIN users   AS u ON n.id_user = u.id WHERE u.id_regiao = '1' AND   MONTH (r.dia_domingo...
asked by 30.11.2015 / 22:30