php - Limiting number of student registering for hostel -
i'm working on hostel registration systems seems trouble limiting number of students can apply hostel.for example hostel1 have 100 rooms,what should when 101th person register getting message saying hostel1 full. i'm using html,php,css , jquery languages project
just assuming have database , stores
hostel_id, hostel_name, max_rooms, occupied_rooms
you need update occupied_rooms field every time registers , while registering ensure
max_rooms > occupied_rooms
you same using arrays suppose.
edit use database administration tool add new table called hostels fill initial hostel data
or use the sql command
create table database_name.hostels ( int hostel_id not null primary key auto_increment, varchar(50) hostel_name not null, smallint max_rooms not null default 100, smallint available_rooms not null default 100 )
Comments
Post a Comment