$title="Citas para Régimen de Incorporación Fiscal"; include "../bootstrap.v4.1.3/includes/header_data.html"; include "../agenda_repecos/conexiones/connect.class"; include "../agenda_repecos/funciones.php"; function zerofill ($num,$zerofill) { while (strlen($num)<$zerofill) { $num = "0".$num; } return $num; } $Conn=new pg_conexion("","agenda_repecos","postgres","",""); //print_r($Conn); $qryFolio="SELECT nextval('repecos_id_seq') as max"; $Conn->set_query($qryFolio); $Conn->ejecuta(); $dato=$Conn->regresa_registro(); $nextval=$dato[max]; $folio="RIF".zerofill($nextval,5); ?>