Dropdown Concatenation

Sometime you want to display multiple fields in a dropdown during editing such as last name and first name . 

The workaround is to create SQL view e.g.

// make sure give an alias to concatenated fields.
CREATE VIEW v_names AS 
SELECT ContactID,CONCAT(FirstName,' ', LastName) AS Name FROM contacts

Then in phpGrid, you can do
$dg -> set_col_edittype("ContactID", "select", "SELECT ContactID, Name FROM v_names");


Feedback and Knowledge Base