Failed to query database : <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
	//Get Value
	$username = $_POST['user'];
	$password = $_POST['pass'];
	
	//Connet To The Server And Select Database 
	mysqli_connect("192.168.xxx.xxx", "xxx", "xxxxxxxxxxxxx");
	mysqli_select_db("xxxxx");
	
	//Query The Database For User
	$result = mysqli_query("select * from user where username = '$username' and password = '$password'")
		or die("Failed to query database ".mysqli_connect_error());
	$row = mysqli_fetch_array($result);
	if (empty($username)) {
		header('Location: fa.html');
	} elseif (empty($password)) {
		header('Location: fa.html');
	} elseif ($row['username'] == $username &amp;&amp; $row['password'] == $password){
		header('Location: su.html');
	} else{
		header('Location: fa.html');
	}
?&gt;</code></pre>
</div>
</div>

I have no experience to code PHP so i have no idea what's wrong is my code.
I have replace "mysql" into "mysqli" but it is still not working correctly.
It's work fine when running "mysql_*" and using my local Window web server.
But when i put it into Linux server it occur error message "Failed to query database ".</p>
