check if data inputted in textbox has exist

check if data inputted in textbox has exist

Hi,

I have mysql database with table name `tblengine` where lots of engine number stored on it, I want to check first if the data (string,numbers) that users has been inputted in textbox (<input type='text' class='input-xlarge' name='engine_number[]' id='engine_number' value=''> in my html) is already exist in tblengine before I proceed to inserting the engine numbers in tblengine.

if the data matches in the records, there will be notification example 'Data has been duplicated' and the form will not be submitting unless there is no duplication showing.

here is the thing,

I have php array where textbox (with validation of engine number) could be more than to one.

please see code

  1.     <tr>
  2.       <td class='text-right'><input type='text' class='input-xlarge' name='model[]' id='model' value='SUZUKI150'>SUZUKI150</td>
  3.       <td class='text-right'><input type='text' class='input-xlarge' name='engine_number[]' id='engine_number' value=''></td>
  4.     </tr>
  5.     <tr>
  6.       <td class='text-right'><input type='text' class='input-xlarge' name='model[]' id='model' value='YAMAHA150'>YAMAHA150</td>
  7.       <td class='text-right'><input type='text' class='input-xlarge' name='engine_number[]' id='engine_number' value=''></td>
  8.     </tr>
  9.     <tr>
  10.       <td class='text-right'><input type='text' class='input-xlarge' name='model[]' id='model' value='KAWASAKI150'>KAWASAKI150</td>
  11.       <td class='text-right'><input type='text' class='input-xlarge' name='engine_number[]' id='engine_number' value=''></td>
  12.     </tr>
  13.     <tr>
  14.       <td class='text-right'><input type='text' class='input-xlarge' name='model[]' id='model' value='HONDA150'>HONDA150</td>
  15.       <td class='text-right'><input type='text' class='input-xlarge' name='engine_number[]' id='engine_number' value=''></td>
  16.     </tr>   

If you have reference (URL or tutorial) with same scenario that I been saying above please post it here. It would be helpful for me.