How to prevent inserting data to database if data is exist in database
ex : I have data
for ($i = 1; $i <= 10; $i++) {
$text = "Orange";
mysql_query("INSERT INTO fruit (text) VALUES ('$text')");
}
I want the text "orange" is inserted once to the "fruit" table
and if there is text "Orange" again its not inserted to the "fruit" table
because the data is exist and have been inserted before