Page 1 of 1

Combine 2 or 3 fields

Posted: 2015-07-13 06:57
by scorpio_x73
Hi and thanks in advance for any help.

i 'm using this code

Code: Select all

$data['machineid'] = ($data['clientID'] . " - " . $data['devicecompany'] . " - " . $data['devicetype'] . " - " . $data['mainserialnumber']) ;
to combine some fields.

The problem is that clientID, devicecompany, devicetype are lookup fields and so i get the id instead of the value.

I'm not good with php )trying to learn), can someone please tell how i can do it ?


thank you all again.

Re: Combine 2 or 3 fields

Posted: 2015-07-13 13:44
by a.gneady
You need to query the parent table for each lookup field. For example, for the clientID field, assuming you want to retrieve the clientName field from the parent clients table, you can do so using this code:

Code: Select all

$clientName = sqlValue("select clientName from clients where clientID='{$data['clientID']}'");
Then use $clientName in your code line.