Jump to content

lasha

Members
  • Posts

    45
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

lasha's Achievements

Member

Member (2/5)

0

Reputation

  1. CroNiX thank you for the support and attention. This is not a mask for what I did, I did it because of lack of time. Inevitably, in the near future, I'll do it as you suggested. When I finish, I'll come back and write about how I did and what I got. Thank you again
  2. Barand OMG it seems to work!!! Perfect Answer! :D
  3. Ok i used STR_TO_DATE()... But i wanted to know how to write correctly the qery WHERE piece. name | start_date | end_date rocky | 08/09/2014 | 08/12/2014 nancy | 08/13/2014 | 08/15/2014 arry | 08/16/2014 | 08/19/2014 This is where i came now... WHERE STR_TO_DATE(start_date, '%m-%d-%Y') BETWEEN STR_TO_DATE(start_date, '%m-%d-%Y') - INTERVAL 3 DAY AND STR_TO_DATE(start_date, '%m-%d-%Y') but it doesn't work
  4. CroNiX its varchar cyberRobot but there is 5000+ record in db Is there any other way to do that... i don't care in this step if it will be slow search time. I have no time for modifying this huge script for now... I have a panic
  5. Barand yes it is the date fromat. damn what to do? if i use STR_TO_DATE() what will heppen?
  6. cyberRobot thank you for attention There is db records: name | start_date | end_date rocky | 08/09/2014 | 08/12/2014 nancy | 08/13/2014 | 08/15/2014 arry | 08/16/2014 | 08/19/2014 I want to show records 3 day before start_date ... this is the goal... t must count down 3 days, 2 days ,1 days. thanks
  7. Yes it is close to it but i explain better, if start date is 8 and today is 5th, i want to show this record between 5 and 8. So i thought if it there will be between start_date (8th) minus 3 day and start_date. Is this good logical solution?
  8. Thank you for post Im trying to get records 3 days earlier before start date... and when start date will be today it must dissapear. Thats all story... Output must be names with start date: Rocky Star Plastic - 08/05/2014 I have no idea how to write it correctly
  9. No no im going crazy... i cant figure out how to write correctly. I tryed every combination and it doesnt show what i need... why it is so hard to do...? "SELECT metal, plastic, all_matts, instrmnts FROM take WHERE start_date BETWEEN ADDDATE('start_date', INTERVAL 3 DAY) AND start_date"; im new to all this and dont know how to write it correctly.. plz help
  10. I made research but I can't reach the goal... Don't know what am i doing wrong... can you help with this? i don't know how to write correctly WHERE start_date BETWEEN start_date -3 day AND start_date Thanks
  11. Thanks for post Jacques1, I want to show records 3days erlier before it starts and if started it must dissapear
  12. Hellow, i need help please, writing code and it doesn't work. please help... Here it is WHERE start_date BETWEEN 'start_date".strtotime('-3 day')."' AND 'start_date'"; without this code everithing works fine Thank you
  13. Thank you very much Psycho... I successfully added to my module, code that you provided for me. It did the thing. I'll keep in mind every word you say. Thank you again This is current working code. And it works perfectly ) $query2 = "SELECT car.id, car.model, car.engine, car.passenger, car.liters, car.transmission, car.doors, car.engine_type, car.luggage, car.condintioner, car.stereo, car.gps, car.propulsion, car.price1, car.price2, car.price3, car.price4, car.img, car.thumb, car.owner, car.location, car.state FROM car WHERE car.id NOT IN ( SELECT car_id FROM books WHERE books.start_date < '{$requestEnd}' AND books.end_date > '{$requestStart}' ) AND car.cat_id = $cat_id AND car.location = 'london' AND car.state = 'published'";
  14. Thanks for helping Psycho, it is correct ideas what you gave to me, i guess my query was illogical but to succesfully accomplish this idea i need more help becouse my query is more complex than i posted above. How to translate at your way? I stuck here This is real query in my booking module SELECT car.id, car.model, car.engine, car.passenger, car.liters, car.transmission, car.doors, car.engine_type, car.luggage, car.condintioner, car.stereo, car.gps, car.propulsion, car.price1, car.price2, car.price3, car.price4, car.img, car.thumb, car.owner, car.location, books.car_id, books.start_date, books.end_date FROM car LEFT JOIN books ON car.id = books.car_id WHERE car.cat_id = $cat_id AND books.car_id IS NULL AND car.location = 'london' AND car.state = 'published' OR car.cat_id = $cat_id AND books.start_date NOT BETWEEN '" . $_POST['start'] . "' AND '" . $_POST['end'] . "' AND books.end_date NOT BETWEEN '" . $_POST['start'] . "' AND '" . $_POST['end'] . "' AND car.location = 'london' AND car.state = 'published' GROUP BY car.id"; EDIT: Also, Never use POST data directly in your query. The code above has some logic to prevent malicious input to cause SQL injections. I will keepin mind
  15. Hello all Have a problem with some query and i'll explain it now... I attached image file with tables which i have SELECT car.id, car.model, books.id, books.car_id, books.start_date, books.end_date FROM car LEFT JOIN books ON books.car_id = car.id WHERE books.car_id IS NULL OR books.start_date NOT BETWEEN '" . $_POST['start'] . "' AND '" . $_POST['end'] . "' AND books.end_date NOT BETWEEN '" . $_POST['start'] . "' AND '" . $_POST['end'] . "' GROUP BY books.car_id"; when car with id 1 is booked 1 time, car doesnt appears if book date range is matches to users choosen date range, but when car with id 1 is booked 3 times it appears 2 time becouse time range matched only one record of book table. i want that if time rage is matched even for one books record, dont show this car at all.. Please help with this and tanks you p.s. Sorry for my English
×
×
  • 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.