gpt4 book ai didi

php - 无法在数据库表中插入值

转载 作者:行者123 更新时间:2023-11-29 07:44:20 24 4
gpt4 key购买 nike

我正在尝试在数据库中插入值,但无法做到这一点

<?php
if(isset($_POST['submit']))
{
$fullname=$_POST['fullname'];
$contactnumber=$_POST['contactnumber'];
$email=$_POST['email'];
$qualification=$_POST['qualification'];
$postappliedfor=$_POST['postappliedfor'];
$sql_connection=mysql_connect("localhost","root","admin","interview");
mysql_select_db("interview,$sql_connection") or die("cannot select DB");
$sql=mysql_query("INSERT INTO `USERDEATILS`(`id`,`fullname`,`contactnumber`,`email`,`qualification`,`postappliedfor`) VALUES('','$fullname','$contactnumber','$email','$qualification','$postappliedfor')");
if($sql){
echo "done";
}
else{
echo "There is an error!!";
}
}


?>

最佳答案

换行 mysql_select_db("面试,$sql_connection")

mysql_select_db("面试", $sql_connection)

关于php - 无法在数据库表中插入值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28249742/

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