This topic is locked

Simple Array Question

1/27/2015 5:18:16 AM
PHPRunner General questions
mcgeepj2 author

I have a field on my list page with an array to display a persons full name:
$value = $data["lname"].', '.$data["fname"]." ".$data["mi"];
I have another field from a lookup wizard where the lookup table used is 'lu_rank' and the display field name is 'rank'. How do I add this to my array to display after $data["mi"] I can't figure out the right syntax.

Sergey Kornilov admin 1/27/2015

Via $data[] array you can only access fields that are part of the main SQL query.
If your lookup wizard display field is not a part of main table SQL query you can add it there via INNER JOIN i.e.

select lname, fname, mi, rank from mytable

inner join lu_rank on mytable.somefield = lu_rank.somefield