query-builder Questions
2
Solved
I an looking to use a JOIN to select data from a table and a view in CakePHP like so :
$this->Annonces->find('all')
->where($arrFiltres)
->order($arrOrder)
->join([
'table' =>...
Iminourea asked 13/2, 2015 at 19:32
1
This is a search function that returns each member with their most recent year registered.
I got it working with a DB::raw() call. But can't get it working with the query builder.
Working Code:
...
Decembrist asked 14/7, 2016 at 2:46
1
Solved
I have 3 entities associated this way:
Don't worry, I've set associations using annotations, but I thought the following mix would be lighter/cleaner to expose my issue
Post
@ORM\ManyToOne(targe...
Columbuscolumbyne asked 7/7, 2016 at 17:37
3
Solved
I'm using MySQL and have a table of 9 million rows and would like to quickly check if a record (id) exists or not.
Based on some research it seems the fastest way is the following sql:
SELECT EX...
Hereld asked 16/11, 2014 at 4:45
1
Solved
So in my database I have table called website_tags, which contains id, title and so on, and also I have table called websites, with similar construction. And also there is table called assigned_tag...
Medical asked 7/6, 2016 at 7:56
1
Solved
Events hasMany TicketTypes
TicketTypes belogsTo Events
I am trying to retrieve all events with associated ticket types:
$query= $this->Events
->find()
->select(['id', 'name'])
->a...
Tachymetry asked 19/5, 2016 at 12:38
2
DBAL Query Builder:
http://www.doctrine-project.org/api/dbal/2.3/class-Doctrine.DBAL.Query.QueryBuilder.html
ORM Query Builder:
http://www.doctrine-project.org/api/orm/2.3/class-Doctrine.ORM.Query...
Kurtkurth asked 30/4, 2016 at 20:17
2
How I could check if the alias is already defined?
There is no method for check this.
Thats not working because I got only the ROOT alias and no join aliases.
/** @var $query \Doctrine\ORM\Query...
Ramsgate asked 20/3, 2014 at 15:31
4
Solved
I have a very simple entity(WpmMenu) that holds menu items connected to one another in a self-referencing relationship (adjecent list it's called)?
so in my entity I have:
protected $id
protected ...
Rephrase asked 29/11, 2012 at 10:6
5
Solved
Are there any (good/usable/not ugly) JavaScript/interface libraries for managing the creation of custom boolean style queries, similar to the Google Analytics Advanced Segment interface?
Basicall...
Caudex asked 26/1, 2012 at 16:59
2
Solved
I have a DB Schema like this (from this tutorial by Google) -
So the actual points in a graph for them is like this-
What I want is to find points near a given point (by point_id) point order...
Haphtarah asked 16/3, 2016 at 4:37
1
Solved
This is my query with query builder, and it works perfectly, bringing all the results of user table and the modules table, which has a many to many association:
public function getUser($id){
$qb ...
Concessionaire asked 28/2, 2016 at 16:35
2
Solved
I'm refactoring a Zend Framework 2 application to use doctrine 2.5 DBAL instead of Zend_DB (ZF1). I have the following Zend_Db query:
$subSelect = $db->select()
->from('user_survey_status_e...
Woodhead asked 13/1, 2016 at 14:9
4
Solved
There is a query I use to run in mysql :
select * from my_table where $val between col1 and coL2;
It works fine, but with laravel 4, the only way to make that query is to have something like
my...
Rhiamon asked 27/11, 2013 at 0:35
1
Solved
I am trying to achieve this elasticsearch query in java querybuilder for elasticsearch. But i am not able to get the equivalent results. Can anyone help with this.
GET /XX/XX/_search
{
"query"...
Ablation asked 29/1, 2016 at 0:43
3
Solved
It is convenient that laravel model provides a method that it can return results from another associated table.
For example, I have a table called item and another table called feedback, where the...
Densmore asked 20/1, 2016 at 11:6
2
I have the following code base to share with you guys to list the pages that fetch using the query builder via AJAX call. We have to pass the URL and the parameters to fetch the child pages from th...
Mcclimans asked 17/9, 2014 at 2:7
3
hello how do i get the max value of scores, where column ID range starts at 3-5
example table
I want to get the max value of scores, where column ID ranging from 3-5
, please help,
what I have...
Kerri asked 8/9, 2015 at 3:31
2
Solved
I have a form that I am building using the FormBuilder:
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('rosters', 'entity', array(
'class' => 'R...
Craniate asked 15/7, 2015 at 13:52
3
I'm facing some troubles with query builder in many to many relationship.
I have an entity Company which have subcompanies as well, so I have:
class Company {
private $id;
/**
* @var ArrayColle...
Unpolled asked 15/4, 2013 at 10:51
1
Solved
I am using JQuery QueryBuilder in my HTML page. I have followed the installation guide. My HTML head includes the following
<script src="bower_components/jquery/dist/jquery.min.js"></sc...
Imf asked 28/6, 2015 at 12:3
1
Solved
I have an entity named PointsComptage.php and another one named Compteurs.php.
This is the relations between them:
// Compteurs.php
/**
* @var \PointsComptage
*
* @ORM\ManyToOne(targetEntity=&q...
Mease asked 24/6, 2015 at 8:32
1
Solved
I have a fullname column for authors and would like to extract the surname into another column. I do that with the following raw SQL:
SELECT name,
SUBSTRING_INDEX(`name`, ' ', -1) AS `surname`
FRO...
Mertens asked 15/6, 2015 at 13:6
2
Solved
The problem is that it displays all the rows from db instead of displaying only those rows which contain search keywords.
public function search($data)
{
$name = $data["name"];
$surnam...
Foulard asked 20/5, 2015 at 18:25
1
Solved
I have this query:
SELECT * FROM blog
LEFT JOIN (
SELECT blog_id, AVG(value) as blog_rating FROM blog_ratings
GROUP BY (blog_id)
) T ON T.blog_id = blog.id;
I do not know how to write this wit...
Talyah asked 17/5, 2015 at 9:17
© 2022 - 2024 — McMap. All rights reserved.