如果让我猜的话,我会说你的桌子没有
name
名称
价值
这至少可以帮助您查明任何潜在问题,并解决SQL注入漏洞。。。
<?php
// show any errors
ini_set('display_errors', 'On');
// show all errors
error_reporting(E_ALL);
// make MySQLi throw exceptions
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$conn = mysqli_connect("xxx", "xxx", "xxxxxxxx", "xxxxxxx");
// safely get the request parameter
$email = isset($_POST['email_r']) ? $_POST['email_r'] : null;
// Prepare a statement with a placeholder for the "email" parameter
$stmt = $conn->prepare('SELECT `name` FROM `participantes` WHERE `email` = ?');
// bind the parameter
$stmt->bind_param('s', $email);
$stmt->execute();
// bind results. This seems easier than fetch_assoc IMHO
$stmt->bind_result($name);
// fetch records, if any
if ($stmt->fetch()) {
echo 'your name is: ->', $name, ' <- that is it.';
} else {
echo "Email Incorrecto: No se a registrado.";
}
$stmt->close();