-2

Kindly provide me SQL query:

We want to select all details from a table where date is equal to particular date and time is between some time period(dynamically).

For example I wish to get all the details of the students where they registered in particular date between particular time.

  • 1
    You could of solved this through a simple Google. http://stackoverflow.com/questions/1469689/select-mysql-query-between-date – Andrew Khan Feb 16 '16 at 12:44

1 Answers1

0

Try this query:

<?php
$date = date('Y-m-d');
$sql = "SELECT * FROM tbl_stu WHERE reg_date = '$date' AND reg_time >= '$time_1' AND reg_time <= '$time_2'";
?>
Pathik Vejani
  • 4,263
  • 8
  • 57
  • 98