Jump to content

johnadamson

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

johnadamson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Barand, that worked fantastic!! Thanks for you help everyone!!!
  2. sorry, meant to say that it thinks there is NO collision of bookings! surely there must be a query that checks to see if the new arrival and departure date is not in the database?? I also tried doing: SELECT propertyid, arrival_date, departure_date FROM bookings WHERE ( arrival_date BETWEEN '$arrival_date' AND '$departure_date' ) OR ( departure_date BETWEEN '$arrival_date' AND '$departure_date' ) AND (arrival_date >= '$arrival_date' AND departure_date <= '$departure_date') but that didnt work either. HELP
  3. that worked a treat!! so is there no way I can check between these 2 dates? e.g. if I try and add a booking from 2008-03-13 to 2008-03-18 it thinks that there is a collision of bookings.
  4. okay. so how do I check to see if a booking has clashed between the 2 dates? even if I was to do it seperately I still wouldnt know how to go about doing it?
  5. Hi, I am trying to develop a booking system in PHP with MySQL but I am having trouble writing some code that checks to see if a new booking clashes with another. e.g. in the database I have a booking that runs from 2008-03-10 to 2008-03-20. When I add a booking I want to check to see if a booking already exists between these dates. Is this possible? I am not an expert with MySQL but the closest I got is to carry out 2 query's: SELECT propertyid, arrival_date, departure_date FROM bookings WHERE arrival_date BETWEEN '$arrival_date' AND '$departure_date' and SELECT propertyid, arrival_date, departure_date FROM bookings WHERE departure_date BETWEEN '$arrival_date' AND '$departure_date but this obviously will not check if a booking is made in between these dates, e.g. if I try and add a booking from 2008-03-13 to 2008-03-18 it will not think that there is a collision of booking. I hope I have made sence and not confused anyone. Your help would be greatly appreciated. Thanks. John
  6. pocobueno1388 that worked an absolute treat!! FANTASTIC!! Thanks for all your help. revraz I tried using ECHO or PRINT originally because I thought that would work, but just got <p>This is some <b>bold</b> text and some <i>italic</i> text.</p> Thanks for your replies.
  7. Dear all, I would like to display html from a database on a webpage, obviously as formatted. e.g. The row in the database is <p>This is some&nbsp;<b>bold</b> text and some <i>italic</i> text.</p> But when I try and print this onto my page is displays <p>This is some <b>bold</b> text and some <i>italic</i> text.</p> Does anyone know how I can display the formatted text as This is some bold text and some italic text. Hope you can help.
  8. Tried creating a new file MadTechie and it still did the same. VERY STRANGE!! The code you provided me jitesh worked well. Thank you. Just a shame I could not get the original php code to work. Thanks for all your help.
  9. I have just tried it again and get the same. I tried using different value: $time1 = "06:55:00"; $time2 = "08:55:32"; echo date("H:i:s",(strtotime($time2) - strtotime($time1))); and I get 03:00:32 when it should be 02:00:32. I really have got no idea why it is doing it.
  10. The code has been working FANTASTIC, but for some reason I am seeing the following: $time1 = "12:55:00"; $time2 = "12:55:32"; echo date("H:i:s",(strtotime($time2) - strtotime($time1))); When I run this it comes back saying that the time difference is 01:00:32, when it should be 00:00:32 (32 seconds). Any ideas would be very much appreciated.
  11. Fantastic jitesh!! That worked an absolute treat. Thanks for your help. Thanks to nikkieijpen also.
  12. is there no way I can display it in hours:minutes:seconds? Or if I used the code you sent me nikkieijpen, can I work out hours:minutes:seconds from the seconds?
  13. HELP!! I am trying to calculate the difference between 2 time strings. e.g: $time1 = "14:00:03"; $time2 = "12:30:03"; The difference needs to be in hours:minutes:seconds. The 2 times will always be different as they are taken from a database (the 2 times above are just examples of how the time is presented). I would VERY much appreciate any help. Thank you in advance.
  14. Also thank you Eugene. That also worked a treat!!
  15. DaveEverFade...You are an absolute LEGEND!! That worked perfectly. Thank you very much.
×
×
  • 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.