Ver originalSELECT (SELECT numerofacturaFROM tutablaWHERE numerofactura = ".$num." - 1) AS anterior, (SELECT numerofacturaFROM tutablaWHERE numerofactura = ".$num." + 1) AS posterior;