0
I have the following PHP function that adds a row to the table:
$idmusica = $_GET['idmusica'];
$queryvota=("
INSERT INTO euk_sugestoes_votos (idusuario, idmusica)
VALUES ($userid, $idmusica)
");
The table has this structure:
id | idusuario | idmusica
But I wanted that before inserting, he checked if this line with idusuario and idmusica already exists. If it already exists, should ignore, otherwise it inserts.
How can I make this check?
Thank you!
I don’t know if this is your case, but be careful if you are using mysql_query as it is obsolete in the current version.
– Marcos Xavier