query-builder Questions

3

I need to get the id of the last record in my table. I have tried: Dao<ParticipantModel,Integer> participantDao = getHelper().getParticipantsDao(); participant = participantDao.query(partic...
Orestes asked 8/4, 2013 at 10:7

2

I am trying to use the hasManyThrough relationship in laravel 5.1 but the sql query is not using the appropriate prefix defined in each connection for each model used. I have 3 models 2 of which us...
Seifert asked 28/1, 2016 at 13:0

5

Solved

I am after a visual query builder along the lines of http://ajax.easyquerydemo.com/. I am using ASP.NET but MVC so would rather something that is not WebForms based like the one in the link. ...
Trigonometry asked 28/4, 2009 at 3:37

6

Solved

How can I update field with query builder in Yii2? I can't find this in documentation. Thanks! UPD This is the solution: // UPDATE $connection = Yii::$app->db; $connection->createCommand(...
Flurry asked 24/8, 2014 at 7:56

4

Solved

I have this query created with doctrine querybuilder, the return i get is an array of arrays. I would like to get a return that is an array of objects, is this possible? I know that normally Doctr...
Gaffe asked 4/7, 2017 at 15:3

2

Solved

Can I use eloquent in migration? The thing is, I need to add some values to the database, based on the relations I have set in the model. I know I could do it by query builder style with some SQL o...
Milesmilesian asked 19/2, 2018 at 14:59

1

Solved

Below given is my code: SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(QueryBuilders.matchQuery("field", "value to search")); Search search = new Se...
Springe asked 10/1, 2018 at 5:52

3

I have code as below to get shipment data where pdf_url is not NULL; $shipment_data = DB::table('shipment')->where([ 'shipment_date' => '2017-12-11', ['pdf_url', '<>', 'NULL']])...
Tribadism asked 12/12, 2017 at 2:0

5

The Problem I would like to automatically add created_by and modified_by fields to every insert/update to a database table in Laravel 4, regardless of whether I am using Eloquent or Query Builder....
Bander asked 23/8, 2013 at 8:40

3

Solved

i try to get results from table with multiple where and/or clauses. But I am not receiving the good result! $queries = journal::where(function($query) { $term =Input::get('text'); $query->where...
Cyndicyndia asked 27/3, 2017 at 10:4

2

Solved

Recently Laravel released version 5.3. There are some upgrade instructions from 5.2 to 5.3 in the following link: https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0 Eloquent scopes now respect ...
Leapt asked 13/7, 2016 at 16:59

2

Solved

I losted trilion hours google this but none of the solutions were good. I have this querybuilder: $qb2=$this->createQueryBuilder('s') ->addSelect('u') ->innerJoin('s.user','u') ->...
Dermatome asked 27/4, 2013 at 17:38

4

Solved

I will go insane with this minimal error that I'm not getting fix. I want to select entries between two days, the examples below ilustrate all my fails: opt 1. $qb->where('e.fecha > ' . $mo...
Verdi asked 19/7, 2012 at 2:39

5

Solved

This should be simple but I can't find a working example. Here's a controller method that throws the error "Invalid parameter number: number of bound variables does not match number of tokens". I'm...
Biota asked 11/9, 2011 at 16:41

1

Solved

it's a WHY-question, not How-to one:) I have assigned a Query Bulder to a variable $query: $query = table::where(['id'=>1, 'this_version'=> 1]); $versions['slug1'] = $query->select('tour...
Papism asked 8/8, 2017 at 15:43

3

Solved

I have many projects and each has many orders, some completed, some not. I want to order them by the amount of completed orders like this: $products = $products->orderBy(function($product) { ...
Fillister asked 27/8, 2015 at 9:36

2

Solved

I have this query, made using Laravel query builder: $rows = DB::table('elements')->where('type', 1); That corresponds to: "SELECT * from elements WHERE type=1" Now, in some cases I need to ...
Urania asked 24/11, 2013 at 19:54

1

Solved

I have 2 tables. Table 1: product_prices: id | price |description |pack |display |created |modified | Table 2: payment_infos: id |payer |pay_date |product_price_id |product_price | In the pa...
Odds asked 31/5, 2017 at 9:58

4

Solved

I'm trying to group my entity by a field (year) and do a count of it. Code: public function countYear() { $qb = $this->getEntityManager()->createQueryBuilder(); $qb->select('b.year, CO...
Extol asked 14/5, 2011 at 8:18

1

Solved

I have some query and I need in select block select id relation entity, how can I do it without some join, like in SQL? In example I add leftJoin but I want understand it's possible without join li...
Ejaculate asked 6/4, 2017 at 7:35

4

Solved

I have been unsuccessfully trying to leftjoin and get the required data Here is my code: $album = Albums::->where('users_id',$user_id) ->leftJoin('photos',function($query){ $query->on(...
Hatcher asked 5/12, 2014 at 13:42

3

Hi I am new to jquery and I came across a product named "jquery-QueryBuilder" and please find its url below http://mistic100.github.io/jQuery-QueryBuilder/demo.html I want to implement that in my...
Control asked 17/8, 2015 at 12:18

1

Solved

I build a search form which will select markers from database where date is inserted in datapicker. That works fine but , when I add time I get error . I rebuilded a query to something like that :...
Runyan asked 13/12, 2016 at 22:10

3

Solved

On my entity I have an array collection of users /** * @ORM\ManyToMany(targetEntity="\UserBundle\Entity\User", mappedBy="acr_groups") */ protected $users; public function __construct() { $this...
Quindecennial asked 9/11, 2016 at 7:42

4

Solved

I'm trying to build a query with the doctrine query builder which joins a non related table like this: $query = $this->createQueryBuilder('gpr') ->select('gpr, p') ->innerJoin('TPost', ...
Magnetics asked 20/6, 2012 at 9:20

© 2022 - 2024 — McMap. All rights reserved.