Use multiple fields in admin list option label dropdown
Hi theclicklab,
So if you select "Get options from mysql query (advanced)" you'll see this default text:
SELECT fieldname1, fieldname2
FROM `<?php echo $TABLE_PREFIX ?>tableName`
You can update that to match your tablename and fields:
SELECT num, email
FROM `<?php echo $TABLE_PREFIX ?>accounts`
First, I'd confirm that works. Next, you want to join two fields together. The first thing I do when I don't immediately know the SQL is to try searching for a few ways to ask that question, eg: https://www.google.com/search?q=mysql+join+two+fields+together From here you see some examples of the CONCAT() mysql function.
The CONCAT() function that joins strings together, so CONCAT(first_name, ' ', last_name) would return what you want. Try this:
SELECT num, CONCAT(first_name, ' ', last_name)
FROM `<?php echo $TABLE_PREFIX ?>accounts`
Let me know if that works for you!
Dave Edis - Senior Developer
interactivetools.com