Line | |
---|
1 | <?php
|
---|
2 | //connect to the mysql
|
---|
3 | include '../include/dbcon.php';
|
---|
4 | $day=$_POST['SelectedDay'];
|
---|
5 |
|
---|
6 | $date = Date('Y-m-d', strtotime($day));
|
---|
7 | $prev = mysql_query("SELECT Date(fStart) AS PrevDate FROM schedule WHERE (date(fStart) < $date) ORDER BY Date(fStart) DESC LIMIT 1");
|
---|
8 | $prevdate = mysql_fetch_array($prev);
|
---|
9 | if(mysql_num_rows($prevdate) > 0) {
|
---|
10 | $prevday = date('Y-m-d', $prevdate['PrevDate']);
|
---|
11 | }
|
---|
12 | else {
|
---|
13 | $prevday = date ('Y-m-d');
|
---|
14 | }
|
---|
15 | echo $prevday;
|
---|
16 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.