我正在尝试将mysqli插入到数据库表中,连接正常,$ _GET ['emailaddress']已填充,表存在,它只是没有插入数据。
$connection = mysqli_connect("localhost","database","password");
mysqli_select_db($connection, "database");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
die;
}else{
echo 'success';
}
mysqli_query($connection, "INSERT INTO `campaign` (`email`) VALUES ('" . $_GET['emailaddress'] . "'");
mysqli_close($connection);
I am trying to do an mysqli insert into a database table, the connection is working, the $_GET['emailaddress'] is populated, the table exist, its just no data is being inserted.
$connection = mysqli_connect("localhost","database","password");
mysqli_select_db($connection, "database");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
die;
}else{
echo 'success';
}
mysqli_query($connection, "INSERT INTO `campaign` (`email`) VALUES ('" . $_GET['emailaddress'] . "'");
mysqli_close($connection);
原文:https://stackoverflow.com/questions/29147127
请发表评论