0
我有一个酒店系统thesw 2表MySQL查询(加入)
预约表
reservation_id pk
Start_Date
End_Date
Customers_Customer_id fk
Rooms_Room_id fk
室表
Room_id pk
type
floor
price
我有这个query
检索可用房间
$sql="SELECT Room_id,type,room_floor,price FROM rooms
LEFT JOIN reservation
ON rooms.Room_id = reservation.Rooms_Room_id
where rooms.type='$_POST[type]'
and Start_Date !='$_POST[from]'
and End_Date !='$_POST[to]'"
所以结果是好的,但它只是给我的预约表 房间我想在预约表,但不是在搜索日期 房间加上在房间表中的其他房间
没有太多的一个mysql的家伙,但是不会使用'$ _POST'!首先消毒!阅读这里http://stackoverflow.com/questions/3645131/what-is-a-good-method-to-sanitize-the-whole-post-array-in-php AND here http://stackoverflow.com/questions/4861053/php-sanitize-values-of-a-array/ – Grmn 2013-04-23 05:06:14
认为你知道该网站是安全湖它只是一个项目,我的拼贴它不会在网上公布 – user2309797 2013-04-23 05:26:50