php - Getting Labels of id's -
what best way labels of id's .
here problem i'm facing .
i have many tables contains id's (subject_id , level_id , place_id , etc..)
what best way display labels of id's without making complex sql query when displaying (have minimum of 6'ids) ?
the other options not nice call get_label(id,table,lang)
but of course can see problem each column (total queries = column * rows)
any better solution or i'm stuck without doing join on 6 tables ?
if it's helps i'm using kohana
here have ...

and subject table subject_id :

i have every field_id table correspond .
in term of performance better making join or calling query specific label when needed . ?
you want use sql join this.
select t1.*, t2.subject_en, ... table1 t1 join table2 t2 on (t2.id = t1.subject_id) a join has better performane - have single query can optimized database engine while doing select while iterating on rows initial query give n+1 separate queries.
Comments
Post a Comment