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

Posted by Ken Chau on 01/31/06 08:23

Well, that sounds like a classic case of normalized tables with a
foreign key pointing to a different table:

create table products (
id int primary key auto_increment,
product_number int
);

create table quantity_costs (
id int primary key auto_increment,
product_id int,
cost float,
quantity int
);

a simple query as below will get you your costs:

select * from products p, quantity_costs c where p.id = c.product_id;

------------

Ken Chau
http://www.gizzar.com

 

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

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