|
Posted by Max Cantor on 01/30/06 20:42
This feels like a "newbie" question to ask, but I've done some research
and I just haven't quite figured it out yet.
Tables are basically two-dimensional arrays. However, I need to have
one field in each row point to an array with an arbitrary amount of
columns (it's a table containing the per-item cost of the product as a
function of quantity). If I had a discrete amount of columns, I could
just have the "pointer field" contain the ID of the corresponding row,
but this is situation seems stickier.
If I were implementing this structure in PHP, it would look something
like this:
<?php
$products[0]['prod_name'] = "Billboard Magnet";
$products[0]['prod_number'] = 100908;
$products[0]['quantity_costs'] = array(
array( 500, 1000, 2500, 5000, 10000 ),
array( .80, .66, .56, .50, .45 )
);
?>
Does MySQL have an existing infrastructure for dealing with
three-dimensional arrays, or tables with arbitrary amounts of fields?
I think I read something somewhere about "linked tables" but I haven't
been able to find any specifics.
Thanks!
Navigation:
[Reply to this message]
|