title: Error in PHP script
body: <p>I wrote a PHP script. When i try to use it throws an error.</p>
  
  <pre><code>Parse error: syntax error, unexpected T_STRING in /Applications/XAMPP/xamppfiles/htdocs/login2.php on line 11
  
  line 11- $query = “SELECT * FROM login WHERE username = ‘$un’ AND password = ‘$pw’”;
  </code></pre>
  
  <p>I am running Apache and MySQL using XAMPP on my mac.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>This is the code I am using in the script</p>
  
  <pre><code>&lt; ?php
  
  $un=$_POST['username'];
  
  $pw=$_POST['password'];
  
  //connect to the db
  
  $user = ‘su’;
  
  $pswd = ‘passwd’;
  
  $db = ‘people’;
  
  $conn = mysql_connect(‘localhost’, $user, $pswd);
  
  mysql_select_db($db, $conn);
  
  //run the query to search for the username and password the match
  
  $query = “SELECT * FROM login WHERE username = ‘$un’ AND password = ‘$pw’”;
  
  $result = mysql_query($query) or die(“Unable to verify user because : ” . mysql_error());
  
  //this is where the actual verification happens
  
  if(mysql_num_rows($result) &gt; 0)
  
  echo 1; // for correct login response
  
  else
  
  echo 0; // for incorrect login response
  
  ?&gt;
  </code></pre>