Help with php and mysql?

Affs Dsfs

New member
Haiii,
iam on a work of creating a website based on php and mysql to hold sales accounts, now iam facing some problem.
While entering records, i specifies an item;s model number, price, etc.
nd these are stored in a table called sales
and i have got table for each models
so like if model number is d50,
I have got a table called d50 which takes data from sales table, ( i used query to select data and insert it where modelnumber = d50)
bt when i do that, each time i refresh insert page,, it inserts same records into modelnumber table again and again.
so to prevent that, i added an serial number field in modelnumber table and that is primary key nd this column gets its data from autoid column from sales;
since it is primary key, it wont allow datas from same autoid again. I Thought that wil solve problem.
but it doesnt solve that.. what this query does is, display the error message nd stops their..
How can i make a query which will check it, nd if a record with same serial nunber exists, then skip that nd insert next..
 
Back
Top