Questions tagged [query-builder]
A query-builder is a set of classes and methods that is able to programmatically build queries.
hi how can we implement a condition checks in laravel query builder
$query = DB::table('customer');
I have Symfony 4 width Doctrine, two entities/tables with relation Fixture (one) - Picture (many). Both tables has column with name "order".
I am loading (eagerly) all fixtures and its pictures. I am ...
I am trying to create a query that searches for first and last name. Here is my original query.
$em = $this->getDoctrine()->getManager();
$qb = $em->createQueryBuilder();
I am working on importing a CSV file to Users.
And I want to create them a custom field "display order", and populate it if such custom field exists for model Users.
What I've done to ...
I'm trying to learn Symfony. Today I was following The associations tutorial. I decided to make a small application that a House, Kitchens, Bedrooms, and cabinets. I (tried to ;-) ) make a small Class ...
im refactoring a pretty ancient TYPO3 extension codebase from pibase to extbase. one part is to rework the old mysql approach from
$queryBuilder = ...
I am trying to sum the total amount of user payments for one day period (24 hours..)
My query is returning all results even if dates are far from 24 hours range.
How to fix this?
resultDaily = $...
I am trying to make this controller more dynamic by allowing the controller to be able to make a search with First and Last name. Right now, the controller only search by first name and last name and ...
I have two query builders defined.
First: Returns all accounts of an user.
Seconds: Returns all user transactions by account.
public function getAccountsList($user)
I am trying to create an endpoint that queries from a filter list and spits out the results. The below code send all the results back but i am trying to create something where i can use $filter=...
I'm trying to perform a query on the CRX of a 6.2 Adobe AEM version.
I have to execute a fulltext query on (aNode is a generic subnode of /content/connect/it/supplier/):
1) all properties of /...
I am trying to add OR SQL Query Statement to my CakePHP project, but notice I am getting AND instead of OR.
I am getting this string when I use SQL(), and no OR is include whereas OR is expected
I am Using eagerCursor() in createQueryBuilder to avoid a for loop and collect the ID's using single group query.
It Speeds up that specific function very much, I feels like overall application is ...
I'm working on Bus Station Management System. and i'm trying to queue bus in Schedule.
so what i want is this:
i want to display all buses of specific station that are not in queue of specific ...
I need to get all last inserted IDS while inserting multiple records at a time but right now I'm getting only one ID.
const data = await querybuilder('surveyresponse').insert(varList)
My task involves using elastic search (5.6) for running queries of the format
word1 AND word2 AND word3
QueryBuilder builders = QueryBuilders.boolQuery()
I'm currently working on my first Laravel project and I'm working with a database that has rows like this:
id message timestamp
1 first 1500000000
1 second ...
I am using an eloquent query to retrieve data from a table. The table columns look like this:
id started_at finished_at
1 06/02/2019 06/15/2019
2 06/05/2019 06/11/2019
What I want to ...
I need to transform this SQL query to KnexJS query
INNER JOIN ...
I have an array called $slugs and I need to receive data form database table called posts in single array how to archive that ?
Getting a sql error in my query, i believe maybe is malformed my query builder but cant figure out what im doing wrong.
Alredy tried testing my query directlly in the DB and it works, but when ...
I made two count queries with query build doctrine but after I found that there is several query count that repeats so I must work with UNION but there is no union in doctrine query build.
So the ...
I hope there are a few helpful and prefer German Symfony experts. For many years I have been working with PHP and now I tryed in a framework. I chose Symfony now because I like the components the most....
I create three query build queries, I try to combine them into a single query doctrine but I do not know how to achieve
the purpose of creating a single request is to eliminate the round-trip client ...
I have 2 entity (Rule and analysisRule)( association one to many)
I try to make a query that counts the number of idAnalyseRule that have an idAnalyse pass as a parameter in the function
I want to change this query to doctrine but I couldn't.
select * from table1
left join table2 on table2.hotel_id = table1.id
left join table3 on table2.table3_id = table3.id
left join (
In general, I would like to extend the query builder to MySql functions or send nativie queries.
I want to get all records from the sys_category_record_mm table with several categories.
For this I ...
I have done a Union in cakephp 3, however the union is doing it such that the buyers table records are shown first and then the tenants. Whereas i want it to be arranged based on created field in ...
I have a MySQL query like bellow, and I want to use it in laravel controller,
I know how to use join in laravel, but I don't know how to write it when we have another sub query in the join statement,...
I have Article and Category entities.
That entities not related by mapping but i need join Category to Article using query builder and as result i need Article entity with injected in Category entity. ...
Is this possible to create a query by JPA QueryBuilder
select DISTINCT substring(min(sel."order"), 2)
(SELECT s.name || d.name "name",
I am trying to pass a SQL result from my PHP-made website to my C# APP that I'm making with Xamarin Forms. I've done this by making A REST API endpoint in my PHP application and therefore calling the ...
can someone please tell me, why i am not able to select section from sections table using left join. i want list of teachers in a table, i am able to access all data from teachers table, but i am not ...
I'm building search functionality for my app. To simplify things:
there are two tables: shops and subscriptions
Each shop can have multiple subscription records, subscription has field expires_at. ...
i have a problem with the Doctrine queryBuilder.
I have two entites : Donations, and Donateurs. I just want to do a left join (because Donations.donorId refer to Donateurs.id, for example.)
The query ...
I have SQL query (see example).
But I can't find a way how I can write it in Query Builder.
Do you have any ideas how is it possible?
WITH main AS (
SELECT id FROM table1
SELECT * FROM table2
Im generating a lot of data that i would like to store in DB, sometime part of data that i would store already exists in DB. How can i insert bulk amount of records without looping them all?
I'd like to make a MySQL query with doctrine2 QueryBuilder (Symfony 3.4 app) with a NOT BETWEEN statment.
The doctrine provide a ->expr()->between(..) but not ->expr()->notBetween(..)
I wrote some complex api to return results from stdClass objects in my controller.
That part works fine.
Then, in my service I wrote a query builder that needs to restrict results to 6 months period....
I'm getting this below error on deploying my aws lambda package on node 8.10.0 but it works fine in my local windows.
let modules = tools.walk(path.join(__dirname, `../sql/`));
on logging the ...
I have a problem with my query builder but I do not know how to fix this error can you help me please?
So here is my problem, I want to retrieve the list of questions that are not in my questionnaire ...
I want to seed my db that shows me this error:
Call to undefined method Illuminate\Database\Query\Builder::passengers()
this is databse seeder:
public function run()
My code is selecting all data from teachers table and showing only id's from connected tables instead of nations name. when i try to select any table except teachers it doesn't work.
public static ...
I have a query to return company details, but if the field used for left join is empty query returns error .How to solve this?
I'm trying to get a single value from Query Builder in Laravel but the problem is I'm getting an array.
this is my query result in Postman with dd($myVar):
and also with echo($...
I want to build something with an aliases column like below, but I don't know how to make it a Laravel query. The following is my SQL.
I have two queries.
$createdServer = Server::where('created_at', '>=', \Carbon\Carbon::now()->subMonth())
->selectRaw('COUNT(id) as createserver, DATE(created_at) as date,DAY(created_at) ...
I'm currently trying to connect my frontend Ionic application with my Node.js backend application. The connection between the apps have been tested before and already deployed to Azure (which works ...
Hei there, I'm new in laravel and I have some issues with laravel query builder. The query I would like to build is this one:
Select nofaktur, date, diskon, namacust, SUM(subtotal)+SUM(diskon)) as
Using Symfony 3 want to alias my user avatar to id, so I will get an array where my keys will be ids and values the field
$qb->addSelect('i.avatar as id');