Re: staff table-howo to connect with bookings and bus. users table
Posted by: Dimitris Papageorgiou
Date: February 26, 2014 01:59PM

here is the DLL for the 2 remaining tables,users and buz_usertype:
CREATE TABLE `users` (
`user_ID` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`lastname` varchar(45) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`hash` varchar(32) DEFAULT NULL,
`usertype` enum('1','2','3','4','5') DEFAULT NULL,
`Reg_date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`user_ID`),
KEY `fk_users_usertype1_idx` (`usertype`),
CONSTRAINT `fk_users_usertype1` FOREIGN KEY (`usertype`) REFERENCES `usertype` (`type_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8

CREATE TABLE `buz_usertype` (
`User_type` varchar(25) NOT NULL,
`Type_id` enum('1','2','3','4','5') NOT NULL,
PRIMARY KEY (`Type_id`),
UNIQUE KEY `Type_id_UNIQUE` (`Type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

And now an important note I want to make.As I said(and you can see from the DDL of the staff table)the staff table has a stafID column which is the primary key and which is referenced from the appointments table.

Τhe user will be able to select staff from a dropdown menu and in which every staff name is associated with a value, which value is the staffID-as you understand these values are gotten(populated) from the database and they vary depending the staff name and with whom business user is associated with.
Here is a short HTML example:
<label>Staff</label><br>
<select class="dropdown" id="staff" >
<option value="1">Maria</option>
<option value="2">Joanna</option>
</select>

Question:
How the above sound like?Is it practical?Is there any chance that might cause an complications for which I cannot think right now.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.