Questions tagged as 'query'

1
answer

Querying child objects that satisfy condition on parent objects, Relationship with eloquent laravel

I have two tables in my project that relate, but I would like to make a query consult that would bring all the child entities that one field would be equal to the parent entity, being for all parent entities that satisfy a specific condition....
asked by 17.10.2017 / 13:01
1
answer

PDO query error

I have the following code: @$import = $dbconn->prepare("UPDATE t SET"); if(a <> "") { $import .= "teste2= '$a', teste= '$b', "; ... It returns this error: Catchable fatal error: Object of class PDOStatement could not be convert...
asked by 27.11.2018 / 16:25
1
answer

Good practices with great queries? [closed]

Are there good practices when it comes to SQL queries within php? Or is there an alternative not to "dirty" the code with a giant query in the middle? Edit: What I was looking for was just views, but I did not know the name to look for, the answ...
asked by 08.02.2017 / 22:02
1
answer

How to retrieve a specific information within this array?

I made a SQL query in the WordPress database that returned all the information regarding a request, however I need to store some of this information in variables and I do not know how to do it. $pid returns the ID of requests identif...
asked by 22.01.2016 / 21:06
1
answer

Sql query formatting in just one line

In some cases, when we save a query .sql, even if it is indented correctly in SSMS when we open it in notepad (windows) all the text stays in a line only, joining END with GO (ENDGO) at the end of a change in procudere ( for example). How to...
asked by 09.01.2018 / 18:23
3
answers

Show query (Problem Id's different)

I have a rather large query but then when I ask to show it comes with the mixed id's. Is there anything wrong with the query? SELECT * FROM tb_detalhe_trabalhador1 inner join tb_empresa on tb_detalhe_trabalhador1.id = tb_empresa.id Inne...
asked by 13.08.2014 / 12:52
2
answers

I have a QUERY that does not display what I really need

My Query: select id from clientes where cliente = '$cliente' AND status = '2' AND (tipo <> '0' AND (disponibilidade <> '0' OR vanual <> '0' OR vtemporada <> '0')) I need it to work as follows: You may see som...
asked by 15.03.2016 / 17:24