php - which database storage option is better for faster processing on android..? -
i trying create hotel room booking application. far have done when user selects check-in date, check out date , type of room , app checks availability , returns status accordingly … if rooms available selected date new row gets inserted in database particular dates , types of rooms …
here code this
$con = mysqli_connect(host,user,pass,db); $type = $_post['pincode']; $cin = $_post['cin']; $cout = $_post['cout']; $sql="select * avalability type = '$type' , cout>='$cin' cin<='$cout'"; $res=mysqli_query($con,$sql); $check=mysqli_fetch_array($res); if(isset($check)) { echo "rooms not available"; } else { echo "rooms available"; $insert="insert login.avalability(type,cin,cout) values('$type','$cin','$cout')"; $mysqli_query($con,$insert); } mysqli_close($con); ?>
now question …. better way or store entire date database 2 years or , change status column , keep changing status 1 when room booked , 0 when room free …. when user check room availability code has check status see if 1 or 0 , return result accordingly
Comments
Post a Comment