通过电子邮件查找UserID时,我不断收到错误消息

时间:2019-03-20 23:23:29

标签: php html mysql mysqli

   <form method="GET">
        <div class="form-group">
            <label for="Email">E-mail</label>
            <input type="text" class="form-control" name="Email" 
  id="Email" required>
        </div>
  </td></tr>
  <tr><td align="center">
            <button type="submit" name="Submit" class="btn btn- 
   primary">Submit</button>
    </form>

这是表格,因为它在同一页面上,所以不执行任何操作。

$test = mysqli_connect("localhost", " ", " ") ;
$dbname = " " ;
$db = mysqli_select_db($test, $dbname);

这是数据库的连接部分。空白输入在实际页面上不是空白。

$email = $_GET['Email'] ;
$query1 = mysqli_query($test, "SELECT email, UserID FROM Leden2 WHERE 
email='$email'");
if ($query1) {
$aName1 = mysqli_fetch_assoc($query1);
$name1 = $aName1['UserID'];
$name2 = $aName1['email'];
echo $name1 ;
echo $name2 ;
} else {
echo "ERROR" ;
}

这会不断出现错误,这意味着结果为零,但我确信它应该有一个结果。我该怎么办?

0 个答案:

没有答案