Сама ошибка:
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''users' WHERE 'username' = 'admin'' at line 1 in E:\open_server_5_3_7_basic_full\OpenServer\domains\localhost\index.php:7 Stack trace: #0 E:\open_server_5_3_7_basic_full\OpenServer\domains\localhost\index.php(7): mysqli_query(Object(mysqli), 'SELECT 'address...') #1 {main} thrown in E:\open_server_5_3_7_basic_full\OpenServer\domains\localhost\index.php on line 7
Код файла:
<?php
if ($_POST['enter']) {
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
include 'bd.php';
$username = mysqli_real_escape_string($db, $_POST['username']);
$row = mysqli_fetch_assoc(mysqli_query($db, "SELECT 'address' FROM 'users' WHERE 'username' = '$username'"));
if (!$row) {
require_once 'block_io.php';
$block_io = new BlockIo($apiKey, $pin, $version);
$result = $block_io->get_new_address(array('label' => $username));
if ($result->status != 'success') {
exit('Error 001');
//Ошибка генерации адресса
}
$row['address'] = $result->data->address;
mysqli_query($db, "INSERT INTO 'users' VALUES ('$username', '$row[address]')");
}
exit('<p>Адресс для оплаты: <br>'.$row['address'].'</br></p>');
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pay</title>
</head>
<body>
<form method="post" action="/index.php">
<p>Username</p>
<p><input type='text' name='username'></p>
<p><input type='submit' name='enter' vulue='Перейти к оплате'></p>
</form>
</body>
</html>
Что за ошибка и как её решить?