title: mysql_query() error in PHP form
body: <p>So I use to program in PHP my own way and then someone told me to start using his way.
  This of course caused me to do a few mistakes.
  So this is the code:</p>
  
  <pre><code>&lt;?php 
  function SignIn()
  {
  $con = mysqli_connect('localhost','root','avi1574','test');
  if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  session_start();
  if(!empty($_POST['user_w'])) 
  { 
  $query = mysql_query($con, "SELECT * FROM `Users` where `User` = '$_POST[user_w]' AND  Password = '$_POST[pass_w]'") or die(mysql_error()); 
  $row = mysql_fetch_array($query) or die(mysql_error());
  if(!empty($row['User']) AND !empty($row['Password'])){
       $_SESSION['user_w'] = $row['Password']; 
  echo "Logged in."; 
  }
  else{ 
  echo "Sorry, wrong password."; } }}
  if(isset($_POST['submit'])){
       SignIn(); 
  } 
  ?&gt;
  &lt;h1&gt;My login page&lt;/h1&gt;
  &lt;form action="tsql.php" method="POST" &gt;
  &lt;input type="text" name="user_w" size="20"&gt;&lt;/input&gt;
  &lt;input type="password" name="pass_w" size="20"&gt;&lt;/input&gt;
  &lt;button type="submit" name="submit"&gt;Sumbit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When I submit the form I get the following error:
  <code>Warning: mysql_query() expects parameter 1 to be string, object given in test-main/htdocs/test/tsql.php on line 10</code></p>
  
  <p>Line 10 is: <code>$query = mysql_query($con, "SELECT * FROM</code>Users<code>where</code>User<code>= '$_POST[user_w]' AND  Password = '$_POST[pass_w]'") or die(mysql_error());</code> </p>
  
  <p>Thank you in advance!</p>