If going to a database isn't an option, the following php code (adapted from example 1 at http://us2.php.net/fgetcsv) may give you a start:
@$serial = $_POST['serialnobox'];
$row = 1;
if (($handle = fopen("./tkmanuals/serialnos.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
if($data[0]=="$serial") {
echo "The first number is $data[1] and the second number is $data[2]<br>";
}
}
fclose($handle);
}
How you want to handle these is up to you. I can't tell from your code if the serial number is a string - in that case you should use string comparison, not the ==
sign, to check for the serial number in the first column data[0]
.
I would reiterate my recommendation to make a database; you can create a simple user interface for the CAD engineer to add / edit parts and part numbers (in other words - "hide" the fact that this is a database from the user). You are sure to end up with only one copy of the information (plus backups) which is a vital step in data integrity: the moment you have more than one copy of the information, they will get out of sync...