我尝试使用php参数化查询更新查询,但我的表没有更新。在php上:
$strquery="UPDATE tborder
SET notestat=?
, bayar=?
, tglout=CONVERT(DATETIME,?,103)
WHERE nota=?
AND tglIn BETWEEN CONVERT(DATETIME,?,103) AND DATEADD(day,1,CONVERT(DATETIME,?,103))";
$stmt1=sqlsrv_query($conn,$strquery,array($nstat,$vbayar,$tglo,$vnota,$stgl,$stgl));
这个输出我从SQL分析器得到如何执行php代码
exec sp_executesql N'UPDATE tborder
SET notestat=@P1
, bayar=@P2
, tglout=CONVERT(DATETIME,@P3,103)
WHERE nota=@P4
AND tglIn BETWEEN CONVERT(DATETIME,@P5,103) AND DATEADD(day,1,CONVERT(DATETIME,@P6,103))',N'@P1 varchar(3),@P2 varchar(5),@P3 varchar(16),@P4 varchar(1),@P5 varchar(16),@P6 varchar(16)'
,'confuse','50000','02/04/2017 08:31','2','01/04/2017 00:00','01/04/2017 00:00'
go
---------------------
(0 row(s) affected)
问:怎么写引用日期?