伊夫更新錯後得到了這樣的文字:的strtotime PHP函數輸出的PHP文件的好時機,但在MySQL
mysql_connect('localhost', 'xxx', 'xxx');
mysql_select_db('xxx');
$sql = "SELECT * FROM rl_cronjobs";
$sql = mysql_query($sql);
$row = mysql_fetch_array($sql);
$sunday = $row['next_sunday'];
$today = date('Y-m-d');
if($sunday == $today){
$sql = "DELETE * FROM xxx WHERE stala != 1";
$sql = mysql_query($sql);
echo $nextsunday;
$nextsunday = strtotime("next Sunday");
$nextsunday = date('Y-m-d', $nextsunday);
$sql = "UPDATE xxx SET next_sunday = $nextsunday";
$sql = mysql_query($sql) or die (mysql_error());
echo $nextsunday;
}
而且在MySQL它的價值是:1984年 我需要它是未來的正常日期星期日
MySQL錶行的類型是varchar,因爲當我設置tu日期時它不會更新。任何幫助?
'1984 = 2012 - 12 - 16' :) –