Re: [PHP-DB] insert several data for one customer

2007-10-10 Thread OKi98

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



RE: [PHP-DB] Autorunning a file

2007-10-10 Thread Lasitha Alawatta

If u don't have permission to ur command line;
Try to solve ur thing by using 

01) Meta refresh
OR
02) JavaScript - setTimeout() function.

Regards,
Lasitha
  


-Original Message-
From: Alexander [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 10, 2007 7:34 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Autorunning a file

Is there anyway to auto execute a PHP file? I'm working on a script that

tracks activity and IPs of visitors, and then at a certain time daily
emails 
me the results.

Any idea of a way to do this? 

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


DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for the 
addressee only. If you are not the named addressee you must not disclose, copy 
or take
any action in reliance of this transmission and you should notify us as soon as 
possible. If you have received it in error, please contact the message sender 
immediately.
This e-mail and any attachments are believed to be free from viruses but it is 
your responsibility to carry out all necessary virus checks and DOTW accepts no 
liability
in connection therewith. 

This e-mail and all other electronic (including voice) communications from the 
sender's company are for informational purposes only.  No such communication is 
intended
by the sender to constitute either an electronic record or an electronic 
signature or to constitute any agreement by the sender to conduct a transaction 
by electronic means.


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



Re: [PHP-DB] Autorunning a file

2007-10-10 Thread Alexander
Thanks for the replies. I'm going to have to check what the server is, I'm 
not the one with the hosting account, so no direct access to the server 
(yet, will probably get it when I need to).


The only problem I see with thise solution here is that the page that the 
script will be in won't be directly accessed, which is a requirement for 
JavaScript. I plan to keep this as a hidden file, so the visitors aren't 
aware of its existence. I thought of creating a script on the index that 
checks the time and if it's a certain time runs the script for this, but 
then I realized that there may not be a visitor calling the index at the 
time I need it.


I'll look into the cron job.

Thanks again,
Alexander


- Original Message - 
From: Lasitha Alawatta [EMAIL PROTECTED]

To: Alexander [EMAIL PROTECTED]; php-db@lists.php.net
Sent: Wednesday, October 10, 2007 7:10 AM
Subject: RE: [PHP-DB] Autorunning a file



If u don't have permission to ur command line;
Try to solve ur thing by using

01) Meta refresh
OR
02) JavaScript - setTimeout() function.

Regards,
Lasitha



-Original Message-
From: Alexander [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 10, 2007 7:34 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Autorunning a file

Is there anyway to auto execute a PHP file? I'm working on a script that

tracks activity and IPs of visitors, and then at a certain time daily
emails
me the results.

Any idea of a way to do this?

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


DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for 
the addressee only. If you are not the named addressee you must not 
disclose, copy or take
any action in reliance of this transmission and you should notify us as soon 
as possible. If you have received it in error, please contact the message 
sender immediately.
This e-mail and any attachments are believed to be free from viruses but it 
is your responsibility to carry out all necessary virus checks and DOTW 
accepts no liability

in connection therewith.

This e-mail and all other electronic (including voice) communications from 
the sender's company are for informational purposes only.  No such 
communication is intended
by the sender to constitute either an electronic record or an electronic 
signature or to constitute any agreement by the sender to conduct a 
transaction by electronic means.


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