<?php
if (isset($_POST['Login'])){
$Username = $_POST[ 'UserName' ];
$password = $_POST[ 'Password' ];
$user = 'localhost';
$pass = '';
$db = new PDO('mysql:host=localhost;dbname=ovs', $user, $pass );
$sql = "SELECT * FROM Voters WHERE UserName=:UserName";
$query = $db->prepare( $sql );
$query->execute( array( ':Username'=>$UserName ) );
$results = $query->fetchAll( PDO::FETCH_ASSOC );
foreach( $results as $row ){
$password_hash = $row[ 'password' ];
print_r( $password_hash );
}
$login_query3=mysql_query("select * from voters where Username='$UserName' and Password='$Password' and Status='Unvoted' and Year='2nd year'") or die(mysql_error());
?>
tried this code in my login area but seems not to be working.what am i missing out on??