我的用户填写一个将数据发送到数据库(MySQL)的表单,然后将用户重定向到一个php脚本,该脚本最近由用户呈现信息,但是渲染脚本需要用户输入的数据的id,i需要从表单中发布这些数据,有什么想法吗?
这是插入的php代码:
$sql = "INSERT INTO `freedomshare`.`post` (`id`, `title`, `content`, `datetime`, `author`, `private`, `password`, `comments`, `qrcode`, `counter`, `editable`, `active`) VALUES (NULL, '" . addslashes($_POST['title']) . "', '" . addslashes($_POST['input']) . "', NOW(), '" . addslashes($_POST['author']) . "', $private,'" . addslashes($_POST['password']) . "', $comments, $qrcode, '0', $editable, '1');";
mysql_query($sql);
Run Code Online (Sandbox Code Playgroud)
有没有办法知道执行这行后id获得的值?