1

so I'm using Zend DB select and the join() function to join two tables...

there are two columns in the joined tables that have the same name (say it's column "id") (and I'd like to keep it that way)

but then when I use Zend_Paginator::factory() on the object, the results would only have one "id" entry from one of the two tables...

how do I specify zend so that it'll return the id entry of one specific table over the other? ie. how do I choose which table to have the "id" value returned when there are multiple tables with the same column named "id" that are joined with each other

1 Answer 1

3

You can specify a field or list of returned fields as second parameter of from() OR third parameter of join(), joinLeft() .... I mean 'OR' because you can't return field with same name twice.

You can specify returned fields using: null (none will be returned), '*' (all will be returned), array (values will be real field names, keys will be aliases - if needed)

zend.db.select.building.columns - Adding Columns

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.