insert several data for one customer

insert several data for one customer

am 10.10.2007 07:06:29 von Fahmi Basya

------=_Part_3705_29069893.1191992789833
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi, All,

I have problem to insert several data for one customer.

description:
the customer buy some product


example:
customer= jojo.
he buy= hat,coffee and milk

problem:
i confused for inserting data to mysql, because i just can insert only one
product to mysql, i have already use an array inside my php script for
insert all variable product but when i push submit button the array only
contain one product.


question:
1. How is the way to create this script ...?


i will very appreciate any suggestion,

regards,

Fahmi

------=_Part_3705_29069893.1191992789833--

Fwd: insert several data for one customer

am 10.10.2007 07:14:10 von Fahmi Basya

------=_Part_3738_18140793.1191993250508
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

---------- Forwarded message ----------
From: Fahmi Basya
Date: Oct 10, 2007 12:06 PM
Subject: insert several data for one customer
To: php-db@lists.php.net

Hi, All,

I have problem to insert several data for one customer.

description:
the customer buy some product


example:
customer= jojo.
he buy= hat,coffee and milk

problem:
i confused for inserting data to mysql, because i just can insert only one
product to mysql, i have already use an array inside my php script for
insert all variable product but when i push submit button the array only
contain one product.


question:
1. How is the way to create this script ...?


i will very appreciate any suggestion,

regards,

Fahmi

--
Fahmi Basya
www.fahmi.web.id
YM : basya_fahmi
VOIP Rakyat Number : 34752

------=_Part_3738_18140793.1191993250508--

Re: insert several data for one customer

am 10.10.2007 11:57:56 von Oskar

Fahmi Basya napsal(a):
> Hi, All,
>
> I have problem to insert several data for one customer.
>
> description:
> the customer buy some product
>
>
> example:
> customer= jojo.
> he buy= hat,coffee and milk
>
> problem:
> i confused for inserting data to mysql, because i just can insert only one
> product to mysql, i have already use an array inside my php script for
> insert all variable product but when i push submit button the array only
> contain one product.
>
>
> question:
> 1. How is the way to create this script ...?
>
>
> i will very appreciate any suggestion,
>
> regards,
>
> Fahmi
>
>
table 1:
CREATE TABLE customer (
idCustomer INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (idCustomer)
) comment="table containing customer personal data"

table 2:
CREATE TABLE goods (
idGoods INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (idGoods)
) comment="table containing infos about goods"

table 3:
CREATE TABLE customer_goods (
idCustomerGoods INT NOT NULL AUTO_INCREMENT,#customer can buy the
same stuff more than one time, it's up to you how you ensure uniqueness
in this table
idCustomer NOT NULL INT ,
idGoods NOT NULL INT ,
PRIMARY KEY (idCustomerGoods),
FOREIGN KEY (idCustomer) REFERENCES customer (idCustomer) on delete
cascade/restrict/set null,
FOREIGN KEY (idGoods) REFERENCES goods (idGoods) on delete
cascade/restrict/set null
) comment="goods bought by customer"

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php