zend db table - duplicated column name when using join with Zend_Db_table -


I have two tables, both have a column called 'title' when I enter the two tables to add the following code I use the snippet, so I can not reach a title column.

  Select $ = $ this-> gt; Select (Zend_Db_Table :: SELECT_WITH_FROM_PART); $ Select- & gt; SetIntegrityCheck (wrong); $ Select- & gt; Join ("service", "service.id = lecture.service_id"); Select Return;  

Is there any way to access both columns?

You need to rename one of the columns, so that does not conflict with the other If you pass an alternate third argument to pass another array, you can specify which columns can be retrieved from the included table. If there are one or more entries in the array, the hash key will be used as the property name. With the code below, you can specify the title column of the service table as "service_chitel" in your query results. If you want other columns from the service table, add it to the array, either as desired or without Add without hash.

  Select $ = $ this-> gt; Select (Zend_Db_Table :: SELECT_WITH_FROM_PART); $ Select- & gt; SetIntegrityCheck (wrong); $ Select- & gt; Join ("service", "service.id = lecture.service_id", array ("service_title" => gt; "service.title"); select return;  
< / Html>

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -