为学生分配房间 [英] Assignin rooms to student

查看:50
本文介绍了为学生分配房间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


正在构建一个住房系统

我希望能够为空房间搜索数据库然后

在每个房间分配不超过2名学生


i有一张桌子学生包含学生证

和一张包含房间ID的房间

i构建另一个包含roomID和StudentID

的表,但是如何限制房间的条目不超过两个?

还要搜索是否有空格?


非常感谢高级


问候,

Hello everyone,

am building a housing system
and i want to be able to seach the data base for empty rooms then
assign no more than 2 students in each room

i have a table Student that contains Student ID
and a table Room that contains the room ID
i built another table that contains the roomID and the StudentID
but how can i limit the entries to the rooms to make no more than two?
and also search if for empty spaces?

thank you very much in advanced

regards,

推荐答案



在分配房间之前检查房间如


select count(roomid) )来自maproomstudent mp,房间

room.roomid = mp.roomid


此次检查后是否计数> = 2不要分配,否则分配它

Hi,
Before alloting a room check the rooms like

select count(roomid) from maproomstudent mp ,rooms where
room.roomid=mp.roomid

after this check if count >=2 don''t allot otherwise allot it


Mi ** ***@gmail.com 写道:

大家好,


正在构建住房系统

我希望能够为空房间搜索数据库然后

在每个房间分配不超过2名学生


i有一个表学生,其中包含学生ID

和一个包含房间ID的房间

i构建另一个包含roomID和StudentID的表格

但是我如何限制房间的入场费不超过两个?

并且还搜索是否有空格?


非常感谢你很高级


问候,
Hello everyone,

am building a housing system
and i want to be able to seach the data base for empty rooms then
assign no more than 2 students in each room

i have a table Student that contains Student ID
and a table Room that contains the room ID
i built another table that contains the roomID and the StudentID
but how can i limit the entries to the rooms to make no more than two?
and also search if for empty spaces?

thank you very much in advanced

regards,



听起来像某人的家庭作业...: - )


-

==================

删除x ;来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

Sounds like someone''s homework assignment... :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================




Ravi:

Ravi :



在分配房间之前检查房间喜欢


从maproomstudent mp中选择计数(roomid),房间里面是

room.roomid = mp.roomid


在此检查后如果计数> = 2不要分配,否则分配给它
Hi,
Before alloting a room check the rooms like

select count(roomid) from maproomstudent mp ,rooms where
room.roomid=mp.roomid

after this check if count >=2 don''t allot otherwise allot it



-------------- -------------------------------------------------- ---------

嘿,谢谢,但我怎样才能在php中写这个语句?


这次检查后如果计数> = 2不要分配否则分配

??

:对不起打扰


等待你的回复

-------------------------------------------------------------------------
hey, thanks but how can i write this statement in php?

after this check if count >=2 don''t allot otherwise allot it
??
:s sorry for bothering

waiting for ur reply


这篇关于为学生分配房间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆