Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Front End MVC display the value of three differents tables
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bruno Oliveira  
View profile  
 More options Jul 30 2012, 9:51 am
From: Bruno Oliveira <bmm.deolive...@gmail.com>
Date: Mon, 30 Jul 2012 06:51:40 -0700 (PDT)
Local: Mon, Jul 30 2012 9:51 am
Subject: Front End MVC display the value of three differents tables

Hi, I want create a front end that allows to me display the values of three
differents tables.

Rigth now, I have a little piece of code that allows me display the value
of two differents tables.

$kiosk_id = JRequest::getInt('id');

$db = $this->getDbo();
$query = $db->getQuery(true);

$query->select('t.*, a.box_id, a.box_date_connection, a.box_date_storage,
a.box_obs, a.box_version, a.box_version_date, a.box_placa_mennekes,
a.box_keyboard_version, a.box_downgrade_CPU, a.box_IP');
$query->from('#__carregadores_kiosks AS t');
$query->join('LEFT', '#__carregadores_boxs AS a USING(box_id)');
 $query->where("t.kiosk_id = '{$kiosk_id}'");
$db->setQuery($query);
$row = $db->loadObject();

What are the changes that I must do for that can display the values of
three different table?
My three differents tables are: #__carregadores_kiosks
                                            #__carregadores_boxs
                                            #__carregadores_pens
I try do the following change but without any positive results

$query->join('LEFT', '#__carregadores_boxs AND #__carregadores_pens AS a
USING(box_id, pen_id)');

Any one know what I must do?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Babker  
View profile  
 More options Jul 30 2012, 1:35 pm
From: Michael Babker <mbab...@flbab.com>
Date: Mon, 30 Jul 2012 12:35:30 -0500
Local: Mon, Jul 30 2012 1:35 pm
Subject: Re: [jgen] Front End MVC display the value of three differents tables

Try two separate join statements instead of doing it in one.  com_content has a couple examples to work with.

-Michael

Please pardon any errors, this message was sent from my iPhone.

On Jul 30, 2012, at 8:51 AM, Bruno Oliveira <bmm.deolive...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruno Oliveira  
View profile  
 More options Jul 30 2012, 5:02 pm
From: Bruno Oliveira <bmm.deolive...@gmail.com>
Date: Mon, 30 Jul 2012 22:02:58 +0100
Local: Mon, Jul 30 2012 5:02 pm
Subject: Re: [jgen] Front End MVC display the value of three differents tables

Sorry, but I don«t understand how I do this separation.

You can write a piece of code please?

2012/7/30 Michael Babker <mbab...@flbab.com>

--
Bruno Oliveira
bmm.deolive...@gmail.com

Telm.: +351 916 412 058


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dhanpatsaran  
View profile  
 More options Aug 4 2012, 8:55 am
From: dhanpatsaran <dhanpat.sa...@gmail.com>
Date: Sat, 4 Aug 2012 05:55:02 -0700 (PDT)
Local: Sat, Aug 4 2012 8:55 am
Subject: Re: [jgen] Front End MVC display the value of three differents tables

use select and join twice -

$query->select('a.box_id, a.box_date_connection, a.box_date_storage.....');
$query->join('LEFT', '#__carregadores_boxs AS a USING(box_id)');

and for the second join again use -

$query->select('p.pen_id');
$query->join('LEFT', '#__carregadores_pens AS p USING(pen_id)');


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruno Oliveira  
View profile  
 More options Aug 12 2012, 3:32 pm
From: Bruno Oliveira <bmm.deolive...@gmail.com>
Date: Sun, 12 Aug 2012 12:32:27 -0700 (PDT)
Local: Sun, Aug 12 2012 3:32 pm
Subject: Re: [jgen] Front End MVC display the value of three differents tables

Don't Work :(
Any Ideas? I had already tried some exmples from the com_content folder but
I don't understand that.

I only want display three differents tables in one view =(


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
elin  
View profile  
 More options Aug 13 2012, 9:13 pm
From: elin <elin.war...@gmail.com>
Date: Mon, 13 Aug 2012 18:13:28 -0700 (PDT)
Local: Mon, Aug 13 2012 9:13 pm
Subject: Re: [jgen] Front End MVC display the value of three differents tables

The docblock gives this example with a b and c
$query->leftJoin('b ON b.id = a.id')->leftJoin('c ON c.id = b.id');
https://github.com/joomla/joomla-platform/blob/staging/libraries/joom...

Elin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruno Oliveira  
View profile  
 More options Aug 19 2012, 4:26 pm
From: Bruno Oliveira <bmm.deolive...@gmail.com>
Date: Sun, 19 Aug 2012 21:26:07 +0100
Local: Sun, Aug 19 2012 4:26 pm
Subject: Re: [jgen] Front End MVC display the value of three differents tables

Hi guys (again),

I try your suggestions and I haven't yet good results.

<?php
defined( '_JEXEC' ) or die;

jimport('joomla.application.component.model');

class CarregadoresModelKiosk extends JModel
{
public function getItem()
{
$kiosk_id = JRequest::getInt('id');

$db = $this->getDbo();
$query = $db->getQuery(true);

$query->select('t.*, a.box_id, a.box_date_connection, a.box_date_storage,
b.pen_id, b.pen_IMEI');
$query->join('LEFT', '#__carregadores_boxs AS a USING(box_id)');
$query->join('LEFT', '#__carregadores_pens AS b USING(pen_id)');
 $query->from('#__carregadores_kiosks AS t');
 $query->where("t.kiosk_id = '{$kiosk_id}'");
 $db->setQuery($query);
$row = $db->loadObject();
 return $row;
 }

}

I can't see what I'm doing wrong.
If I put this code, the front end view don't load  the values of the db.
If I delete the parameters  "b.pen_id, b.pen_IMEI" and the
line $query->join('LEFT', '#__carregadores_pens AS b USING(pen_id)') the
front end show to me the parameters that are in the DB #__carregadores_boxs
and #__carregadores_kiosks.

Someone have more suggestions?

With my best regards,
Bruno Oliveira

2012/8/14 elin <elin.war...@gmail.com>

--
Bruno Oliveira
bmm.deolive...@gmail.com

Telm.: +351 916 412 058


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
elin  
View profile  
 More options Aug 19 2012, 7:56 pm
From: elin <elin.war...@gmail.com>
Date: Sun, 19 Aug 2012 16:56:26 -0700 (PDT)
Local: Sun, Aug 19 2012 7:56 pm
Subject: Re: Front End MVC display the value of three differents tables

What does the generated query look like? Does it match the query you have
that works if you run it directly icn your database?
Did you try it the way it is in the do blocks?

Elin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »