Hi all..
I am making a php mysql loginsystem to my webpage.. I got some help from a friend and he said it should work but I get this error :
Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '� and password=�' at line 1
I dont know what is wrong.. Please help..
Here is my code :
<?php
session_start();
include 'config.php';
$username = $POST[‘username’];
$password = $POST[‘password’];
$query = "select * from members where username=’$username’ and password=’$password’";
$result = mysql_query($query)
or die("Query error: ". mysql_error());
if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
include "login.html";
} else {
$_SESSION[‘username’] = "$username";
include "memberspage.php";
}
?>