Hi,

I am trying to design a website, where we have a table containing the days of the week and hours. The idea is to populate this table by its connection to the database.

So two pages: Make appointment:

1. I insert into the database via php website selecting time and day.
2. I view the schedule where the php should access the database to populate the table.


So if I have placed an appointment on monday at 8:00, the table in that time slot should have an entry.

I would really appreciate any example or if you could point me to any existing php scripts that does the above.

regards,

Mike

There are many ways to populate a table based on info you are pulling from a table in db. Have you written the code where you are actively submitting appointments to the the database ?

I haven't written the code but what I don't know how to do is get that particular time slot to be inserted into the database. I don't know how to do it.

I guess it would all depend on what you mean by time slot. If you are referring to a particular day and time I would probably just do something like this.

mysql_query("INSERT INTO appointments SET 
customer='$customer_id', 
day='$day', 
time='$time' ");

Where the values of $customer_id, $day, and $time are defined through a form input.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.