if ($consulta = pg_query($sql)){
echo htmlspecialchars($sql) . " -- ".$arquivo." - SQL OK<br>\n";
}
I have tried the code below but in this case it prints me the error 2x.
if ($consulta = pg_query($sql)){
echo htmlspecialchars($sql) . " -- ".$arquivo." - INSERIDO <br>\n";
}else{
echo htmlspecialchars($sql) . " -- ".$arquivo." - FALHA NO SQL <br>\n";
if (! (strrpos(pg_last_error(), "duplicate key") ) ) {
echo "<b>ERRO --> ".pg_last_error()."</b><br />";
}
}
If I leave only the first code it continues printing the warning.