I have datetime in my table like this 01.08.2012 14:20 22.10.2012 10:02
i enter 2 dates(can i enter them just as 10.08.2012 or i have to add time to ) and i want to do this
$sqlSelectMY='BDate >= "'.$fromDate.'" AND BDate <="'.$toDate.'"';
"SELECT* FROM table WHERE ".$sqlSelectMY.";";
I put the date clause in variable sqlSelectMy and than use it in the variable that i call the select from the mysql database i would like to see some examples if anyone can refer any to me thx. How to write the input dates that will do the thing that i need now with the code there is even if I input dates like i have at the top with time it doesnt do anything…
Use phps function substr() to fix the date format to be YYYY-MM-DD HH:II:SS and use that variable for fromDate and toDate variables , that should do it , I will edit soon with some working code soon as i write it down 🙂