[PHP-DB] help me on projecting some tables

2001-11-16 Thread Carlo Loiudice

Hi,
I've to store in a BD some alimentary product, and
there are lot of informations like chemical, physical,
nutritional characteristics , ...
I don't know how to store this info.
So I've a lot of product with a lot of corresponding
characteristics.

I've thought about to create a table where to store
all chemical characteristics, a table for nutritional,
ecc. and put in the product table the refer ID to all
this caracteristic tables. 
But in this way, there's the problem that now I'm
storing 3 chemical charact. but tomorrow I'd like to
add a new charact., and I wouldn't change tha table
structure adding a new column every time I've a new
field that I haven't expected.

Can someone show me the right strategy to resolve this
kind of problem?

Ciao, Carlo

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] is it a Many-to-Many relationship ???

2001-11-13 Thread Carlo Loiudice

Ok, pardon:
Table1: ID,weight,m_weight,height,m_height
Table2: ID,measure_name
This is the question: I've to build a query that gives
me with a single select, two rows of the table2.
If you can, please give me some hints about this
problem: store data with relatives measure units, and
a way to make format conversions: for example convert
lire to euro, or gr. to kg.
I'm thinking to store in table2 the conversion values.
ciao

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] is it a Many-to-Many relationship ???

2001-11-12 Thread Carlo Loiudice

HI again.
I'm doing this:
I'm a table where there are 4 fields like this:
height,measure height,weight, measure weight.
Then a 2nd table, where I've all measures defibed.

How can I select 2 different rows from the 2nd
(measures) table related to 1 entry in the 1st table
with a single select query?

Thanks, Carlo

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] JOIN operations

2001-11-09 Thread Carlo Loiudice

Hi,
I'm preforming a join between 2 Mysql tables in this
way:
table_name: ID,name,ID_city
table_city: ID,city

when I query this: 
SELECT table_name.name,table_city.ID,table_city.city
FROM table_name,table_city WHERE
table_name.ID_city=table_city.ID

The result is a new table with this fields:
result_table: name,city.
There isn't the field table_name.ID_city!!!

Here's the question: I need also this field ID_city
because there's a function that builds a list box with
all the cities, and search for a html hidden input
named ID_city (like the table field) to eventually
highlight that entry.

can someone help me?
is there a way to select also the ID_city field
without break the join mechanism ?

Carlo

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Automatic JOIN

2001-11-09 Thread Carlo Loiudice

Pardon, another question:
Is there a way to say to Mysql to automatically detect
a relation between 2 table and perform the join
operation when there's a SELECT query ?
I Hope this isn't a stupide question! But I've seen
that in the detested MS Access, there a simple way so
make a visual join between a field in a table with
another field in another table.

When there's a select on the 1st table, access
automatically open the linked table and fetch the
corresponding field.

How to make this in mysql?
Carlo, again

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]