Concatenate fields

T

Tom

Guest
I'd like to have separate name fields ("lastname" and "firstname") for searching and inserting, but view the results in one column ("fullname"). Is that possible, and if yes, then exactly what I have to do?
 
D

Debbie S

Guest
Tom

In DaDaBIK, you can have multiple fields from a linked table display in all views.

For example, from your main table, you wish to link the firstname field and lastname field from the table 'names'. In the admin.php interface configurator for the main table, set the options for the fullname field display to:

Primary key field == nameID
Primary key table == names
Linked fields == firstname~lastname
Order by == can be nameID, firstname or lastname - you choose

For a record like this in 'names' table:

ID | firstname | lastname
1 | Dadabik | User

The display in the DaDaBIK view for the 'main' table will result in:

| some other data | Dadabik User | some other data |

In order to search for either first or last name, change the search operators order (through the admin.php interface configurator) for this field in the 'main' table to default to 'contains':

contains/starts_with/ends_with/is_equal/greater_than/less_then

To insert names into the names table, I would just do that right in the DaDaBIK interface for the names table and anything you add to this table will be available from the main table.


Hope this helps!
Debbie
(Latest version of DaDaBIK when this message was posted: 3.1 Beta)
 

PatKwi

New member
Hi what if one of the Linked Fields in this example is also coming from another table?

When I do this the Linked Fields are displayed as the ID Key of the linked table - when I really need to see the contents of the linked table.

For example:

In an ADDRESS TABLE with addresses I have address and state fields (where state is being linked from a STATES TABLE).

So if I want to create a linked table display that shows:

City~State

I get

Ankorage 52

Instead of what I want which is:

Ankorage Alaska

Thanks
 
Top