Page 1 of 1

Help with PHP Drop Downs linking to MYSQL data

Posted: Wed Apr 09, 2008 11:55 am
by craigshaw
Hi there.
I am new to MYSQL and I have to do a college project using MYSQL and PHP.

I am having a few problems that I hope someone can help me with.

I have two tables:

Customers (Cust_ID(PK), Name, Contact, Add1, Add2, Town, County, Postcode, Telephone, Email)

Timekeeping (Time_ID(PK), Cust_ID(FK), Task_Description, Time_Spent, Recorded_By).

The Cust_ID in Timekeeping is a foreign key linked to Customers(Cust_ID).

It is all going to done in HTML and PHP and will link to the database. I have managed to create a page showing a list of the customers and also to add a new customer.

Now, my problem is, I need to design a form that the staff populate when they have done a task for a customer. The form will be based on the Timekeeping table.

Is there anyway that when they are choosing the Cust_ID that it is for, there is a drop down list or something which shows the available customers so that they can just choose from this?

As well as the above, I want to have a page based on Customers, which will have the customers in a drop down list, and when a customer is chosen from the list, it will display all of the Timekeeping entries against the CustID. How can this be done? I have seen a topic on here which is similar, but I couldn't quite do it as I am pretty new to this. The topic I found is at viewtopic.php?f=1&t=80421.

If anyone can help, I would be very grateful, also, if you need any more details, then let me know and I shall get them posted!

Thanks in advance,

Craig