spoiler<?php
session_start();
require('connect.php');
if (isset($_POST['username']) and isset($_POST['password'])){
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM users WHERE username='$username' and password='$password'";
$result = mysqli_multi_query($connection, $query) or die(mysqli_error($connection));
$count * mysqli_num_rows($result);
if ($count == 1) {
$_SESSION['username'] = $username;
}
else {
$fmsg = "Ошибка";
}
}
if (isset($_SESSION['username'])){
$username = $_SESSION['username'];
echo "Привет" . $username . "";
echo "Авторизация прошла успешно";
}
?>
При нажатии кнопки входа показывает следующее сообщение:
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 'connect.php'); if (isset($_POST['username']) and isset($_POST['passwor' at line 1
В connect.php такой код:
<?php
$connection = mysqli_connect('127.0.0.1:3306', 'root', 'root');
$select_db = mysqli_select_db($connection, 'bdwheelz');
?>