I've created a forum that registers data to a Database once its filled out. However besides the error checks on blank fields, Im also wanting to error check two separate fields that will error check against information within the database already.
For my setup I've created two tables. One holds the information received from he PHP script. The other Table has the information in it that the PHP script will error check against.
For sake of confusion the two columns that the PHP script error checks against are "dCode" & "VIN"
Right now the problem(s) I am currently having are:
1. The dCode and VIN fields of the PHP script have to be correct to a certain extent but not 100% SO as long as the person knows a dCode and a VIN then they can log in. My problem here, is because its within a table the Query I have running now checks to see if dCode and VIN are beside one another.
Code: Select all
SELECT user_id FROM ErrorCheck WHERE (dCode='3313' AND VIN='5J6RE')
SELECT user_id FROM ErrorCheck WHERE (dCode='$dc' AND VIN='$vin')
2. Because I only need the 1st five characters of the VIN I only need to error check against that. The VIN it self is around 17-20 characters. I've created this Query to error check against that.
Code: Select all
SELECT * FROM ErrorCheck WHERE MATCH (VIN) AGAINST ('5J6RE%')
SELECT * FROM ErrorCheck WHERE MATCH (VIN) AGAINST ('$vin%')
Thank you very much in advance!