$today = date('D, d M, Y');
$sql = "SELECT * FROM programs
WHERE day1 = '$today' OR day2 = '$today' OR day3 = '$today' OR day4 = '$today'
OR day5 = '$today' OR day6 = '$today' OR day7 = '$today' OR day8 = '$today'
OR day9 = '$today' OR day10 = '$today'";
if($_POST != "") {
$mydate = mysql_real_escape_string($_POST['datepicker']);
if($mydate != "") {
$sql = "SELECT * FROM programs
WHERE day1 = '$mydate' OR day2 = '$mydate' OR day3 = '$mydate' OR day4 = '$mydate'
OR day5 = '$mydate' OR day6 = '$mydate' OR day7 = '$mydate' OR day8 = '$mydate'
OR day9 = '$mydate' OR day10 = '$mydate'";
}
}
$mydate
結合與日曆....PHP的回聲問題
如何我PHP的echo日期?
值得一提的是,你忘記關閉**第2行**的雙引號 – Marty 2011-06-09 08:10:30
也許這是一個還有時間閱讀[數據庫規範化](http://en.wikipedia.org/wiki/Database_normalization)的一些信息,在表中編號列幾乎不是一個好主意;反正常化的反應,這通常會讓你的生活變得更加困難。 – 2011-06-09 09:00:43