Tag Archives: join

Join tables with comma values

Questions: I have a hard nut to crack with joing 3 tables. I have a newsletter_items, newsletter_fields and newsletter_mailgroups which I want to be joined to get a list of newsletters. The newsletter_items contains the fields: letter_id, letter_date, receivers, template, status That can look like 1, 1234567899, 1,2 (comma separated), standard.html, 1 newsletter_fields contains the… Read More »

How to use Join in Zend Framework

Questions: i am using Join query in zend.. like $select = $table->select() ->from(array(‘e’ => ‘EducationHistory’), array(‘status_DataDictionary_id’)) ->join(array(‘r’ => ‘ReportOrder’), ‘e.id = r.EducationHistory_id’, array(‘reportOrderStatusId’ => ‘r.status_DataDictionary_id’)) ->where(‘r.orderBy_Organization_id = ?’, 4) ->where(‘r.orderBy_Person_id = ?’, 1) ->group(‘e.enrollno’); and to do that i take help from http://framework.zend.com/manual/en/zend.db.select.html but when i try to run that query an error occurs which… Read More »

Doctrine QueryBuilder delete with joins

Questions: I’m trying to use the Doctrine QueryBuilder to perform the following SQL query: DELETE php FROM product_hole_pattern php INNER JOIN hole_pattern hp ON php.hole_pattern_id = hp.id INNER JOIN hole_pattern_type hpt ON hp.hole_pattern_type_id = hpt.id WHERE php.product_id = 4 AND hpt.slug=’universal’; I have this $qb = $this->entityManager->createQueryBuilder(); $query = $qb->delete(‘\SANUS\Entity\ProductHolePattern’, ‘php’) ->innerJoin(‘php.holePattern’, ‘hp’) ->innerJoin(‘hp.holePatternType’, ‘hpt’)… Read More »

how to join two tables in mongodb

Questions: how to join two tables in mongodb. For example, table 1 : users table 2 : examples Here users table having username and examples table also having username, so how to combine both table fields using mongodb in php. Please explain the query. Thanks, Answers:

PHP Mysql joins across databases

Questions: Lets say I have two separate databases, X and Y, on the same physical server. All of my queries currently run out of X. I find I have one table in Y I would like to be available to X for JOINS. So… now I keep a copy of the one table I need… Read More »

Multiple Joins in Codeigniter

Questions: I’m new to building databases and I’m trying to do a JOIN based on a having three database tables. Table A = ID, Name, etc Table B = ID, Name, etc Table C = ID, TableAId, TableBId What I can’t figure out is using active record how to make this selection. I’m trying to… Read More »

How to join array values in PHP?

Questions: I have array 1: Array ( [0] => Array ( [recomendation_id] => 3588 [employee_id] => 90141063 [attendance_type_id] => 2 [start_dtm] => 2016-05-17 10:32:00 [end_dtm] => [request_message] => test notif [recomendation_status_id] => 1 [last_update_dtm] => 2016-05-17 10:32:43 [employee_name] => Nike Yulistia Angreni [attd_type_name] => Permittance [status_name] => Request ) ) And array 2: Array (… Read More »

How to INNER JOIN 3 tables using CodeIgniter

Questions: Can someone Tell me how to join 3 table with php? Example SELECT FROM table1, table2,table on INNERJOIN ——————- let I have 3 table.(question table ,answer table and category table) Here is example form my webpage. Time remaining 30 minutes(I will get “30 minutes” form Category table) 1. Question (from question table) 2. answer… Read More »