This topic is locked
[SOLVED]

 Concatenate First and Last Names

10/14/2014 4:15:27 PM
PHPRunner General questions
M
mrphp author

Hi,
I'm using PHPrunner 7.1 Build 21342 x86.
I have a table called Users which contains 2 name fields, lastname and firstname. There are records for all our employes in this table. I have another table called Purchases. This is used to track purchases and includes a record with a User field that uses Lookup Wizard and pulls from the Users table Linked By lastname and the Display field uses concat(lastname,', ',firstname).
When I create a Purchases record and select the user the choices are listed as "lastname, firstname" like I expected. However, I have 3 users with the last name of Williams (Al, Jim and Robert)and no matter which one I select for a record, after I save the Record it reverts to "Williams, Al".
Is there a way to correct this?
Thanks.

HJB 10/14/2014

... you can modify SQL query to concatenate two fields into one. Use concat function in MySQL for this purpose.
select ...,

concat(firstname, ' ', lastname) as fullname

from ...

M
mrphp author 10/14/2014



... you can modify SQL query to concatenate two fields into one. Use concat function in MySQL for this purpose.
select ...,

concat(firstname, ' ', lastname) as fullname

from ...


That's the ticket. Thanks very much for your help.

I don't think I've ever received a response (at least a correct one) in a forum as fast as I received yours!