You are here: Tables as Three-Dimensional Arrays « PHP SQL « IT news, forums, messages
Tables as Three-Dimensional Arrays

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация