I'm doing a query prepare to avoid the sql injection, but I did not run the page that should show the result, it gives error and I think it's because the functions I'm using are from mysqli, and I'm working with postgresql, I'm not sure if these work they serve with postgres and for that reason the errors, if so, how would the queries prepared with postgres be done?
$busqueda = $_GET['resultado'];
$query = "select * from datos where nombre = ?";
$resultado = pg_prepare($conexion, $query);
$consulta = pg_stmt_bind_param($resultado, "s", $busqueda);
$consulta = pg_stmt_execute($resultado);
if($consulta == false){
echo "Error en consulta";
}else{
$consulta = pg_stmt_bind_result($resultado, $nombre, $apellido, $telefono);
while(pg_stmt_fetch($resultado)){
echo $nombre . " " . $apellido . " " . $telefono;
}
pg_stmt_close($resultado);
}