title: PHP select from database and compare result
body: <p>I have a php script dat is suposse to register users into a database. but first I want it to check d user password with a pin code in the data base and the user password and my db pin match den we add the user details  to the database else we echo an error but I dont seem to be getting it. please help me dis d php script</p>
  
  <p>`</p>
  
  <pre><code>$connect=mysql_connect("$host","$user","$password")
  or die("Bross why na, change the localhost to example site.com without www. ");
  $select=mysql_select_db("$db_name")
  or die("dagogo change the db");
  
  //collection data from registration form and processing encrypting it
  $first_name=($_POST["First_Name"]);//user 1st name
  $last_name=($_POST["Last_Name"]);//user last name
  $username=($_POST["UserName"]);//user special User name
  $phone=($_POST["Phone"]);//user phone number
  $email=($_POST["email"]);//user email address
  $password=($_POST["password"]);//user password
  
      //checking the pin with pin in the database
  
  $query=mysql_query("SELECT * FROM pin_code WHERE pin='$password'");
  $numrows=mysql_num_rows($query);
  if($numrows!=0)
  {
  while($row =mysql_fetch_assoc($query))
  {
  
  $dbpassword=$row['pin'];
  
  }
  if($password==$dbpassword)
  {
  
  
  //inserting the form details into the database.
  mysql_query("INSERT INTO users(first_name,last_name,username,phone,email,password)VALUES('$first_name','$last_name','$username','$phone','$email','$password')")or die ("Registration failed");
  }
  else
  {
  echo"dagogo";
  }
  </code></pre>
  
  <p>`</p>
  
  <p>and kip on get this error <code>Parse error: parse error in C:\wamp\www\9ja School Solution\register.php on line 114</code> wic hapenns to be d last line of d script"?>" please help</p>