Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在尝试在 Sql 数据库表中插入一行,并且该行的最后一列应该包含一个变量,我不知道如何将该变量与日期函数连接起来。问题变成了单引号
$SQL = "INSERT INTO news VALUES (NULL, '$user', '$text'.'date('Y-m-d H:i:s')')";
那个 $text 应该有一个“现在日期”函数在它之后调用,这样我就可以知道它被插入到表中的日期......
谢谢
尝试这个:
$sql = "INSERT INTO news VALUES (NULL, '$user', '$text<br>".date('Y-m-d H:i:s')."')";
你可以试试这个
$SQL = "INSERT INTO news VALUES (NULL, '$user', '".$text." now()')";