我有一个将数据插入数据库的表单。其中一个字段weDate
是填写
$weDate=date('Y-m-d',strtotime('Friday'))
如果我使用以下内容:
$sql = mysql_query("SELECT ID as 'DB_ID',
partnumber as 'Part_Number',
pndesc as 'Part Number Description',
name as 'Name',
reason as 'Reason',
comment as 'Comments',
date as 'Date',
time as 'Time',
weDate as 'Weekend Date'
FROM $table
WHERE weDate = '2013-05-03'");
我得到结果。
当我尝试:
$sql = mysql_query("SELECT ID as 'DB_ID',
partnumber as 'Part_Number',
pndesc as 'Part Number Description',
name as 'Name',
reason as 'Reason',
comment as 'Comments',
date as 'Date',
time as 'Time',
weDate as 'Weekend Date'
FROM $table
WHERE weDate = '$weDate2'");
我什么也得不到。为什么?
PHP 变量是:
$weDate2 = date('Y-m-d', strtotime('-1 weeks Friday')