+----+---------------+-------+---------------+
| id | name | phone | ip_addr |
+----+---------------+-------+---------------+
| 1 | customname001 | 1234 | 192.168.100.1 |
| 2 | customname002 | 2156 | 192.168.100.2 |
| 3 | customname003 | 9685 | 192.168.100.3 |
| 4 | customname004 | 1546 | 192.168.100.1 |
| 5 | customname005 | 1234 | 192.168.100.1 |
+----+---------------+-------+---------------+
In my codeigniter project I am trying to build a model which will help me insert a new row into a table which looks something like the above one. The condition I want to apply here is to check if the combination of name, phone and ip_addr is unique or not.
I know that for a single column if we set the value to be unique then the values can't be repeated but my example is a different case where I want the combination of all the columns(except the id) to be unique.
Can anyone help me here in building the model which will help me to add new pair of name, phone and ip_addr and check if the pair already exists and accordingly give a feedback.