Relation n-n and fields concatenation
- Single Page
Posted 26 September 2012 - 08:31 AM
[font=Arial, Tahoma, Helvetica, sans-serif][color=#2c575b]But instead of the actor's fullname, i have two fields : name and surname[/color][/font]
[color=#0000FF][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]$crud[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]->[/size][/font][/color][color=#006600][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]set_relation_n_n[/size][/font][/color][color=#66CC66][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]([/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'actors'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'film_actor'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'actor'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'film_id'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'actor_id'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'name'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3],[/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'priority'[/size][/font][/color][color=#66CC66][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3])[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3];[/size][/font][/color]
I have only the name
[color=#0000FF][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]$crud[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]->[/size][/font][/color][color=#006600][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]set_relation_n_n[/size][/font][/color][color=#66CC66][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]([/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'actors'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'film_actor'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'actor'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'film_id'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'actor_id'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3], [/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'surname'[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3],[/size][/font][/color][color=#FF0000][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3]'priority'[/size][/font][/color][color=#66CC66][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3])[/size][/font][/color][color=#333333][font=Menlo, Monaco, Consolas, 'Courier New', monospace][size=3];[/size][/font][/color]
I have only the surname
[font=Arial, Tahoma, Helvetica, sans-serif][color=#2c575b]I wanted to concat them in order to have the fullname with the relation[/color][/font]
[color=#2C575B][font=Arial, Tahoma, Helvetica, sans-serif]Is there an easy way to do that ?[/font][/color]
Posted 26 September 2012 - 09:46 AM
$crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', '{name} {surname}','priority');
Posted 27 September 2012 - 14:55 PM