CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 from a table to an ohter ??

Print topic Send  topic

Author Message
bouvet

Posts: 24
Posted: 06/08/2004, 1:32 AM

Hi,

I have a table product. I choose an article.
I want to insert this articel in a antoher table product1.

The 2 tables have the the structure. I just make a duplication.

Thanks
Philippe
_________________
Webdesign Hildesheim Hannover
http://www.actidesign.com
View profile  Send private message
RonB

Posts: 228
Posted: 06/08/2004, 3:08 AM

Why? if you use a relational databse storing the same info twice is a big no no. Creates danger of data inconsistency.
View profile  Send private message
Philippe
Posted: 06/08/2004, 3:30 AM

Quote RonB:
Why? if you use a relational databse storing the same info twice is a big no no. Creates danger of data inconsistency.
because I have to choose the product first.
It's also because I didn't find a nother way :-/ :-/
ghtracey

Posts: 23
Posted: 06/08/2004, 9:52 AM

I think what Ron was trying to tell you is that if you store the ID column from the product table into the product1 table, you won't be storing the data twice, instead you reference the data.

Example:
Product Table:
ID | Name | Description | etc......
Product1 Table:
ID | Other Fields | ProductID

Now, in a query you can view the combined results of both tables with
SELECT * FROM product1 INNER JOIN product ON product1.ProductID=product.ID

I suggest you buy a book on SQL or do some online reading. This type of thing is the basis of a relational database, and is something you should understand before you attempt to code applications.

Cheers.
_________________
Graham Tracey
Council of Yukon First Nations
View profile  Send private message
Philippe
Posted: 06/08/2004, 9:58 AM

Quote ghtracey:
I think what Ron was trying to tell you is that if you store the ID column from the product table into the product1 table, you won't be storing the data twice, instead you reference the data.

Example:
Product Table:
ID | Name | Description | etc......
Product1 Table:
ID | Other Fields | ProductID

Now, in a query you can view the combined results of both tables with
SELECT * FROM product1 INNER JOIN product ON product1.ProductID=product.ID

I suggest you buy a book on SQL or do some online reading. This type of thing is the basis of a relational database, and is something you should understand before you attempt to code applications.

Cheers.

Thank you, I get one but I am lazy or too stupid! in Fact I don't think I explain well my problem. I post a aonther subject. Pehraphs, you can read it
Philipppe

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.