how do you check to see if a number you are tryint to insert into your db is unique?
like this is my situation...
DB - complaint-log
TABLE - mainrecordtable
FIELDS - cn, wo, do, prob, sys, class, dc, res
the fields cn and wo need to be unique... i have them set up in the db to be unique fields....
what i need to know is how do i check to see that "CN-05-522" is not already entered into the cn field of any of the existing records... and if it is not... then continu with:
INSERT VALUES ($cn,$wo,$do,$prob,$sys,$class,$dc,$res) INTO mainrecordtable (cn,wo,do,prob,sys,class,dc,res);
but if the CN is in the db i need it to put out an error message.... and would need to check the wo field as well before the record was inserted.
help????
thanks a million in advance :)
William Gray -
wgray@scottcare.com