I can't for the life of me figure out why this code doesn't work. I'm new to MySQL queries so I may be doing something wrong there.
Here's my login.php
<?php
/**
* Created by PhpStorm.
* User: Michael
* Date: 10/25/2015
* Time: 4:35 AM
*/
require 'connect.php';
if(empty($_POST['Login_Username']) || empty($_POST['Login_Password'])){
header("Location: http://www.socksdevsite.com/PHP_Files/Display_Files/Login/displayloginfailed.php");
} else {
$username = "'DevSock'";
if($db->query('SELECT username FROM users WHERE username = $username')){
echo "Found user";
}else {
echo "Didn't find user";
}
}
My connect.php
<?php
/**
* Created by PhpStorm.
* User: Michael
* Date: 10/25/2015
* Time: 11:58 AM
*/
$db = mysqli_connect('127.0.0.1', 'username', 'password') or die("Error logging in. Please notify an administrator!");
$db->select_db('Website_Storage');
echo "Connected and DB selected <br>";
And finally a screenshot of my phpMyAdmin.
