Questions tagged as 'sql-select'

1
answer

Search for string in SQL / PHP database

Good evening, I have the following select that is to search for users according to their category: $consulta = "SELECT * FROM app_usuarios WHERE cat = '$categ' $ categ is the variable that I get dynamically according to the user's choic...
asked by 23.01.2017 / 22:06
2
answers

Error: 'ExecuteReader: Connection property has not been initialized.'

I need to access a database where I put the data myself, the insert part is working, but now I need to "get" the data again when I click the button, so it does not matter what way I do it you always get this error message:    System.InvalidOp...
asked by 22.01.2017 / 17:30
1
answer

Join with the same table more than once

I'm having a problem performing a query . The original table calls tbl_operacao , and contains the fields: id , tipo_operacao , idimovel , idproprietario , idlocatario , idseguro , idvalores ....
asked by 04.01.2016 / 06:10
1
answer

Search for the next date in the database

I am creating a mysql table where it contains the date of an event. The question is as follows: if in the current day there is an event it is highlighted otherwise the next day. would you have any idea how to do it? The query for the current day...
asked by 26.08.2016 / 19:29
1
answer

relationship between SQL tables [closed]

I have the following problem, I have two stocks in my company, so I have two values for the stock, and the stock record looks something like this: Astheimageshows,eachproducthastworecords,eachreportingthequantityofeachstock.Icannotchangethew...
asked by 24.08.2016 / 07:47
1
answer

where affecting only one field in select

Good morning, how do I make my clause affect only one (1) field in my search? For example: $query = DB::table('proventosdesc as proven') ->join('calculo_rh as calc', 'proven.pessoaId', '=', 'calc.pessoaId') ->join...
asked by 24.05.2016 / 14:21
1
answer

Is there a way to join multiple SELECTS in just one query?

I have a page where I will have to make several queries to the bank. At present, they are a total of three tables. They are: cadastro , publicacoes and estilo . Currently I do this: SELECT nome, sobrenome, usuario, email FRO...
asked by 31.01.2016 / 00:28
1
answer

MySQL GROUP BY - Error in PHP

I have a query in MySQL that, in the command line and in MySQL Workbench, is bringing the correct values, but when executed in PHP, the GROUP BY function is grouping more than it should! Here is the query: SELECT DATE_FORMAT(ctg.d...
asked by 25.02.2016 / 19:17
0
answers

How to resolve the error Notice: Trying to get a non-object property of a select with WHERE

I'm trying to display a list of subscriptions for a particular user. The getuser() method captures the id of the session user and displays the list of entries created by it. However, I'm trying to display these records on screen, while...
asked by 18.11.2018 / 22:23
1
answer

SQL Server 2017 - SELECT with Duplicate Metadata

I made a select using metadata, but the result of my selection brought me something like a 'Cross Join'. Even using GROUP BY and DISTINCT returns with the duplicate values. I would like a help for the values to return correctly ... follows the s...
asked by 05.10.2018 / 21:14