<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
标签 javascript php mysql css
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
我对上述问题有疑问。我在 php 中的代码如下:
$con = mysql_connect(xxxx,xxx,xxx) or die(mysql_error());
mysql_select_db(xxx) or die(mysql_error());
if (count($_POST) > 0) echo "form submitted";
if(isset($submit))
{
$name = $_POST['std_name'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$user_type = "student";
if(mysql_query("insert into login (user_id, user_pass, User_type) values ('$email','$pass','$user_type'", $con))
{
echo "<p class='success_msg'>Congrats! your registration has successfully been done.</p>";
echo mysql_error();
}
else
{
echo mysql_error();
}
早些时候这段代码运行良好,值被输入到数据库中。但突然间它不起作用,甚至没有给出任何错误。如有任何帮助,我们将不胜感激。
最佳答案
关于javascript - PHP Mysql Insert Into 不工作,没有数据发布到数据库时没有错误,早些时候同一页面正在工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26203969/
相关文章:
php - 如何构建 'related questions' 引擎?
PHP - 创建新文件,其中包含 file1 中的所有行,但不包含 file2 中的行中的任何文本
javascript - 如何在 JavaScript 中检查空/未定义/空字符串?
javascript - JS 通过 ID+Class 获取元素
javascript - 如何从一个公共(public)变量中的多个数组中获取名称 id?
MySQL 正在输出二进制十六进制字符串,这些字符串以某种方式解析为文本。这是如何运作的?