Unique Column Data

D

DanW

Guest
Greetings:

I think there was a hack in 2.2, but I can't find it.

Problem: Select Single from another table:

Region Table contains:
|id | region | state | city |
-----------------------------

Now, There will be duplicated entries for:
Region & State ( obviously).

When I'm in Administration, and I setting up the the fields (for another table)

- Primary key field: id
- Primary key table: Region
- linked fields : region
- order by : region


The question is:
How do I limit the returned choice to "unique" names? If I have 50 entries and 10 contain the same region and/or state -- where Do i need to make my change or 'hack' so I present only 1 unique region, state .. etc..



I thank everyone in advance.

dan
 
D

DanW

Guest
I do see ( from business_logic.php)

$sql = "SELECT DISTINCT ".$quote.$primary_key_field_temp.$quote." FROM ".$quote.$primary_key
_table_temp.$quote; // e.g. select distinct ID from my_table

But, alas, Since you can't have duplicate primary keys ( ie: region....)

Can anyone suggest a workaround?
 
E

Eugenio

Guest
DanW wrote:

> I do see ( from business_logic.php)
>
> $sql = "SELECT DISTINCT
> ".$quote.$primary_key_field_temp.$quote." FROM
> ".$quote.$primary_key
> _table_temp.$quote; // e.g. select distinct ID from my_table
>
> But, alas, Since you can't have duplicate primary keys ( ie:
> region....)
>
> Can anyone suggest a workaround?

Try this:
http://www.dadabik.org/forum/read.php?f=1&i=2471&t=2253#reply_2471


(Latest version of DaDaBIK when this message was posted: 3.0 beta)
 
Top