Re: [PHP-DB] Re: Many columns (as FK) vs 3x more Columns (in the same table)

2012-09-20 Thread Bruno Sandivilli
We are getting closer. But I'll give some image to better ilustrate: http://177.71.185.219/stable/anexos/505b18fc713f8imagem.png this is my table in Flex, the fields are in portuguese so 'ignore' it. 2012/9/19 Matt Pelmear mjpelm...@gmail.com Bruno, This schema layout seems a little odd

[PHP-DB] Re: Many columns (as FK) vs 3x more Columns (in the same table)

2012-09-19 Thread Bruno Sandivilli
Anyone? Please. 2012/9/18 Bruno Sandivilli bruno.sandivi...@gmail.com Hi, i strugling to decide what is the best choice: I have a 15 row x 3 columns Flash DataGrid, it means, for each row i have 3 values. To represent this in my Database, I could: 1. Create 2 Tables : A Values table -

Re: [PHP-DB] Re: Many columns (as FK) vs 3x more Columns (in the same table)

2012-09-19 Thread Matt Pelmear
I'm a little confused here. You have a 15x3x3 set of data to display in a 3 column, 15 row datagrid? Are you displaying a single value in each cell of the datagrid, or all 3 values for the cell? How many variables are needed to uniquely select a piece of data from that 3-dimensional space?

[PHP-DB] Re: Many columns (as FK) vs 3x more Columns (in the same table)

2012-09-19 Thread Jim Giner
On 9/18/2012 8:52 AM, Bruno Sandivilli wrote: Hi, i strugling to decide what is the best choice: I have a 15 row x 3 columns Flash DataGrid, it means, for each row i have 3 values. To represent this in my Database, I could: 1. Create 2 Tables : A Values table - with 3 columns ; and a Bill

[PHP-DB] Re: Many columns (as FK) vs 3x more Columns (in the same table)

2012-09-19 Thread Jim Giner
On 9/19/2012 3:12 PM, Jim Giner wrote: On 9/18/2012 8:52 AM, Bruno Sandivilli wrote: Hi, i strugling to decide what is the best choice: I have a 15 row x 3 columns Flash DataGrid, it means, for each row i have 3 values. To represent this in my Database, I could: 1. Create 2 Tables : A

Re: [PHP-DB] Re: Many columns (as FK) vs 3x more Columns (in the same table)

2012-09-19 Thread Bruno Sandivilli
Sorry for the lack of explanation. Again: I have to model a bill table. The bill have 20 fields. But for each field we have: *registered* value, *billed *value and* total value.* So i've created an *bill* table with *20 *fields (representing the bill fields, like: consumption, demand, etc ),

Re: [PHP-DB] Re: Many columns (as FK) vs 3x more Columns (in the same table)

2012-09-19 Thread Matt Pelmear
Bruno, This schema layout seems a little odd to me. Maybe I'm just misunderstanding the use. Correct me if I'm wrong here: Each row in the bill table is a customer? (or some other lookup value for which you're generating the data grid?) I assume the 15 fields from your original message are