If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
-
scorpio_x73
- Posts: 11
- Joined: 2013-11-28 21:00
Post
by scorpio_x73 » 2015-07-13 06:57
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.
-
a.gneady
- Site Admin
- Posts: 1354
- Joined: 2012-09-27 14:46
-
Contact:
Post
by a.gneady » 2015-07-13 13:44
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.
AppGini plugins to add more power to your apps: