-2
我得到了下面的錯誤,而我試圖讓使用SQLite3的致命錯誤的SQLite3 ::查詢()在PHP
Fatal error: Non-static method SQLite3::query() cannot be called statically in C:\xampp\htdocs\s\sqlite\forgot.php on line 16
我嘗試使用sqlite3的製作登錄系統在PHP中PHP忘記密碼的頁面。我在整個登錄過程中都做了正確的操作,但是忘記密碼會讓我的頭髮變成灰色:/這是我忘記密碼的PHP代碼。這是Forget.php
<?php
class MyDB extends SQLite3
{
function __construct()
{
$this->open('test.db');
}
}
$db = new MyDB();
if(!$db)
{
echo $db->lastErrorMsg();
} else{ }
$query = SQLite3::query($db, 'SELECT email, password FROM user LIMIT 25');
$result = sqlite_fetch_all($query, SQLITE_ASSOC);
foreach ($result as $entry) {
echo 'Email: ' . $entry['email'] . ' Password: ' . $entry['password0'];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Forgot Password</title>
</head>
<body>
<form action="" method="post">
<h1> Forgot password!</h1>
<label> Enter Your Email ID : </label>
<input id="email" type="email" name="email" required=" " />
<input id="button" type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
運行查詢你知道什麼是'static',對不對? –