Jump to content

stevochegeoj

New Members
  • Content Count

    7
  • Joined

  • Last visited

Everything posted by stevochegeoj

  1. I have a bookings table represented by the code below, i wish to add a mouseover function to display customer details eg. number of persons in a room,meal plan etc.All data is fetched from the database.How can i go about it? <?php session_start(); if (!isset($_SESSION["user"])) { header("location:index.php"); } require_once(__DIR__ . '/db.php'); //Get all the rooms from the database $roomsSQL = "SELECT TRoom FROM room"; $days = 30; $roomsArray = array(); $roomsResult = mysqli_query($con, $roomsSQL); $roomsArray = array(); while
  2. <?php $tsql = "select * from roombook ORDER BY FIELD(stat, 'Checked in', 'Booked', 'Deposit Confirmation', 'Email/phone', 'Checked out')"; $tre = mysqli_query($con, $tsql); while ($trow = mysqli_fetch_array($tre)) { $co = $trow['stat']; if ($co != "Cancelled" ) { echo "<tr>
  3. $tsql = "select * from roombook ORDER BY FIELD(stat, 'Checked in', 'Booked', 'Deposit Confirmation', 'Email/phone', 'Checked out')"; i re wrote my code as above but still it does not give the desired result. however when i run the same code on phpmyadmin it seems to work. what could be the issue?
  4. I have this code that i tried running it on my phpmyadmin it works fine ,but when i use it on my php code to query its not working.What could be the issue? SELECT * FROM `roombook` ORDER BY (CASE stat WHEN 'Checked in' THEN 1 WHEN 'Booked' THEN 2 WHEN 'Deposit Confirmation' THEN 3 WHEN 'Email/phone' THEN 4 WHEN 'Checked Out' THEN 5 ELSE 'Cancelled' END) ASC, stat ASC
  5. my problem with this is, the option list is populated from the database. Do you mind implementing the code you posted in the quoted code? <select name="troom" multiple class="form-control" required> <option selected="true" disabled="disabled">--Select a room--</option> $records =mysqli_query($con, "select * from room where TRoom not in (select TRoom from roombook where cin <= '$checkout' and cout >= '$checkin
  6. i don't why its returning an empty list. or how will it display? i am learning php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.