"试图获得非对象的属性"这是什么意思?第15行的错误在哪里?

时间:2016-07-13 19:03:28

标签: php mysql mysqli login

我正在尝试成功登录表单。这是我的activation.php文件。这里有点帮助pelase :)。

这是我的代码(很抱歉没有创建代码段,因为我无法找到要创建它的网站):

   <?php
   $servername = "localhost";
   $dbname = "dbtechnerdzzz";

   // Create connection
   $conn = new mysqli($servername, $dbname);
   //Check connection
   if ($conn->connect_error) {
      die("Connection failed: " . $conn->connect_error);
   } 

   $sql = "SELECT * FROM accounts";
   $result = $conn->query($sql);

   if ($result->num_rows > 0) {
   // output data of each row
   while($row = $result->fetch_assoc()) {
     echo "id: " . $row["UserID"]. " - Name: " . $row["Username"]. " " . $row["Password"]. $row["Email"]. " - Name: " . $row["CreatedOn"]. " " . $row["DateOfBirth"]. "<br>";
       }
    } else {
       echo "0 results";
    }
    $conn->close();
    ?>

0 个答案:

没有答案