Jump to content

zed420

Members
  • Posts

    160
  • Joined

  • Last visited

    Never

Everything posted by zed420

  1. Hi All Can anyone please tell me where am I going wrong in code below it fairly straight forward, Style switcher works fine. The problem is When I'm using Firefox background image doesn't show but there no problem in IE. why???? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="styleSheetSwitcher.js"></script> </head> <body><center> <div id="main">Hello <div id="centerbox">world</div> </div></center></body> </html> CSS code #main { position: relative; background-image:url(images/Driving_bkg3.gif); background-repeat: no-repeat; height: 100%; left: 5%; } #centerbox { margin: -20% 3% 0 40%; padding: 0%; width: 41%; height: auto; background-color:#C9F; }
  2. Thanks everyone, Sorted at last this is the final out come SELECT COUNT(*) AS Cnt FROM booking WHERE request_date = '$request_date' AND $e_time > s_time AND $s_time < e_time
  3. Its a form with drop-down boxes of start time and end time A day booking are from 08:00 to 21:00 normally its 1hr a lesson but when its a test its 2hrs. what I don't want is a duplicate of any lesson or Over lapping any lesson. Zed This is my table booking CREATE TABLE booking ( b_id smallint(5) NOT NULL auto_increment, `dateTime` char(15) NOT NULL, user_id smallint(5) unsigned NOT NULL, s_time varchar(10) NOT NULL, e_time varchar(10) NOT NULL, request_date varchar(20) NOT NULL, PRIMARY KEY (b_id), KEY user_id (user_id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
  4. Thanks for your reply I've already tried what you've posted that gives you duplicate bookings the very thing I'm trying to avoid. Thanks Zed
  5. Hi All I've managed to get somewhere with the query below with some help but it has a small problem after rigorous testing I found there is a small glitch e.g. Let’s say if I book from 10:00 to 13:00 and someone tries to book it from 08:00 to 21:00 (all day) IT WILL BOOK, meaning it will over lap. I have tried to sort it but failing miserably, anyone with any thoughts Thanks Zed SELECT b_id, COUNT(*) AS Cnt FROM booking WHERE request_date='$request_date' AND ( ($s_time >= s_time AND $s_time < e_time) OR ($e_time > s_time AND $e_time <= e_time) ) GROUP BY b_id
  6. Thanks for your reply but Unsuccessfull again. This is the background of it, A typical day's diary starts from 0800 till 2100, normally you would book an hr but just to test the script I booked 0800 to 2100 so that means all day has been booked NO other booking can be taken for this day if I DO NOT select the varibles 8 & 21 IT WILL book again and again . ????? why why????? How can I avoid that, s_time and e_time are numbers in database, this is the query I'm using Thanks Zed $query = "SELECT b_id, COUNT(*) AS Cnt 2.FROM booking 3.WHERE request_date='$request_date' 4.AND e_time > '$s_time' 5.AND s_time < '$e_time' 6.GROUP BY b_id"; 7. $result = mysql_query($query); 8. $row = mysql_fetch_assoc($result); 9. if($row['Cnt'] > 0){ 10. error_message('Sorry, this time is already booked. Please choose another'); 11. } else {
  7. Thanks for your reply but I'm no joy. :'( :'( :'(
  8. Error SQL query: SELECT COUNT( * ) AS Cnt FROM booking WHERE request_date = '$request_date' AND e_time > '$s_time' AND s_time < '$e_time' GROUP BY Cnt LIMIT 0 , 30 MySQL said: #1056 - Can't group on 'Cnt'
  9. Thanks for your reply but I'm getting this msg, Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\calendar\booking.php on line 75 thanks Zed
  10. Hi All This query below works and avoids all the Overlaping BUT only for the first recored and thereafter it overlaps. Any thoughts please ??? Zed $query = "SELECT COUNT(*) AS Cnt FROM booking WHERE request_date='$request_date' AND e_time > '$s_time' AND s_time < '$e_time'";
×
×
  • 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.