1. CREATE TABLE details ( 2. s_no int NOT NULL AUTO_INCREMENT PRIMARY KEY, 3. 4. content1sno varchar(50) NOT NULL, 5. 6. content1name varchar(50) NOT NULL 7. 8. content2sno varchar(50) NOT NULL, 9. 10. content2name varchar(50) NOT NULL, 11. 12. content3sno varchar(50) NOT NULL, 13. 14. content3name varchar(50) NOT NULL, 15. 16. ) type=MyISAM;
Here in this sql query s_no is declared as primary key, so it is unique.
There is no chance of adding the same serial no again in s_no. Apart from that it is given as auto increment, so absolutely no chance of having same serial no again
What i need here is content1sno, content2sno, content3sno should also be unique;;;it will have both integers and characters 'varchar';;
If in insert operation, the following value is inserted
In the second insert operation, if the value 12AB is given as input to content1sno=12AB. It should display an error as the same value is given as input to content3sno already.
In the php, during insert operation it should check the database if the value going to be inserted is unique for this three
this three should be unique!!
Why i need this is, it will help me in search operation.