Login Script working local but not on live environment
<p>I seem to have a problem with a login script, it works on a local php dev box, but not on my live environment, i'm assuming i'm missing something can anyone advise further?</p>

<pre><code>&lt;?php
$user = $_POST["swtorun"];
$pass = $_POST["swtorpw"];

// Generate hash
$enc_pwd = hash('sha256', $pass);

// Connect to DataBase
include('../../settings.php');

$conn = mysql_connect($host,$username,$password);
$db = mysql_select_db($database, $conn);

// mySql Query users
$sql = "SELECT * FROM `users` WHERE username='$user' and password='$enc_pwd'";
$result = mysql_query($sql, $conn);

$count = mysql_num_rows($result); // number of results (should be 1)

if($count==1){
// initiate session
session_start();
$_SESSION['logged'] = "1";
echo "you are now logged in, return to the &lt;a href=\"../../index.php\"&gt;index&lt;/a&gt;";
} else {
echo "Wrong Username or Password";
}
?&gt;
</code></pre>
