Wampserver. in phpmyadmin i have added users db and user_data table. but my code doesn't work
<?php
include_once("sql_connect.php");
session_start();
$_SESSION['currentuser']=$_POST['usernameinput'];
$uname = $_POST['usernameinput'];
$pass = $_POST['passwordinput'];
$sql = "SELECT * FROM 'user_data' WHERE(
username='".$uname."' and password='".$pass."')";
$query = mysql_query($sql);
$result = mysql_fetch_array($query);
if($result[0]>0)
{
header ("location: Ghome.php");
}
else
{
header ("Location: loginform_er_incorrectlogpass.php");
}
?>
When i wrote correct username and password it doesn't work. maybe something wrong with my code?
<?php
session_start(); # Starts the session
session_unset(); #removes all the variables in the session
session_destroy(); #destroys the session
include ("LoginForm.php");
echo "<p align='center'><font color='red'>Неправильно указан Логин или Пароль.</font></p>";
?>