2
Well, I have this 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 it already exists in the database, some record with the same data, but it is not working and it continues to insert me equal data.
How could I do this with php?
Have you checked the table names? Have you solved them yet?
– Francisco
Got it! Thanks, the problem was even in the table name I had not read...
– Gonçalo