Php没有从数据库获取任何信息

时间:2017-12-04 22:36:23

标签: php mysql database

为什么在,txt文件(我正在使用测试邮件服务器工具)显示行SELECT mail FROM check_out而不是邮件地址?示例在照片中

编辑代码(仍然没有工作):

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "database";


$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} 

$sql = "SELECT mail FROM check_out";
$to = "SELECT mail FROM check_out";

mail($to , "ORDER", "Your order is placed !","From: vape@v.com");
$_SESSION['message'] = "Order placed succesfuly"; 
header('location:index.php');

if  (isset($_GET['up'])) {
$orderid = $_GET['up'];
mysqli_query($db, "DELETE FROM check_out WHERE id=$orderid");
header('location:index.php');
}



$conn->close();
?>

感谢您的帮助

How email address is displayed

1 个答案:

答案 0 :(得分:0)

我并不完全了解此脚本的用途,但我尝试修复它。 也许这会有所帮助:

{{1}}