gpt4 book ai didi

php - 尝试将 $_POST 插入 MySQL 时没有任何值(value)

转载 作者:太空宇宙 更新时间:2023-11-03 11:02:51 25 4
gpt4 key购买 nike

<分区>

我正在制作一个测验系统,当我尝试从 HTML 表单的 $_POST 插入问题文本时,它只是插入一个空值,而 question_id 保持为零:

        Question text: <br />
<textarea name="qtext" rows="2" style="width:200px; height:100px;" name="qst"></textarea> <br />

PHP 部分

$post_qtext = $_POST['qst'];
$post_qtext = mysql_real_escape_string($post_qtext);
$q_insertquestions = mysql_query("INSERT INTO `questions` (`question`,`type`) VALUES ('$post_qtext','1')");
$q_lastquestioninserted = mysql_insert_id($q_insertquestions);

表格中的question_id是int(11)mysql 中的问题是 varchar(60)

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com