0

有没有更优雅的方式来编写这样的条件?

WHERE date<'".($date+1)."-07-01'

类似的东西

WHERE date<'{($date+1)}-07-01' 
4

1 回答 1

1
$date = 2013;
$truedate = ($date + 1) . "-07-01";

$preparedDb = new DB;
$preparedDb->prepare("SELECT * FROM T1 WHERE date < ?")
   ->execute(array($truedate));
于 2013-01-21T00:35:17.793 回答