title: Check if Number already exist in row mysql database
body: <pre><code>&lt;?php
  date_default_timezone_set('Asia/Manila');
  $conn=mysql_connect("localhost","root","");
      mysql_select_db("dbposo",$conn);
  
  
  if(isset($_POST['add']))
  {
  
  
      if( empty($_POST['fname']) || empty($_POST['mname']) || empty($_POST['lname']))
      {
          echo "&lt;script&gt;alert('Please fill up all the fields!')&lt;/script&gt;";
          header("Refresh: 0;url=admin_publicviolation.php");
      }
  
  
  else
      {
          $number=$_POST['number'];
          $fname=$_POST['fname'];
          $mname=$_POST['mname'];
          $lname=$_POST['lname'];
          $age=$_POST['age'];
          $gender=$_POST['gender'];
          $violation=$_POST['violation'];
          $officer=$_POST['officer'];
          $offenses=$_POST['offenses'];
          $date=date("y-m-d");
          $time=date("H:i:s");
          $price=$_POST['price'];
  
          mysql_query("insert into tblcitizen(number,fname,mname,lname,age,gender,violation,officer,offenses,date,time, price) values('$number','$fname','$mname', '$lname', '$age', '$gender', '$violation' , '$officer', '$offenses','$date','$time','100')",$conn) or die(mysql_error());
  
          echo "&lt;script&gt;alert('Successfully Recorded, First penalty: 100php!')&lt;/script&gt;";
          header("Refresh: 0;url=admin_publicviolation.php");
      }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>i want to reject registration if the $number is already exists in the database, somebody help me? can't figure it out. i can't use some coding method. don't know how to use other</p>