Well, I have following code:
<?php
$link = mysqli_connect("localhost", "root", "vertrigo", "recebecores");
$red = $_GET["red"];
$green = $_GET["green"];
$black = $_GET["black"];
$procura1 = mysqli_query($link, "SELECT * from recebescores where red='$red' AND green='$green' AND black='$black'");
$array1 = mysqli_fetch_array($procura1);
if($array1["red"] == ""){
$inserir1 = mysqli_query($link, "INSERT INTO recebecores (red, green, black) VALUES ('$red', '$green', '$black')");
}
?>
I want to check if a record with this same data already exists in the database, but it is not working and it continues to enter the same data.
How could I do this with php?