×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Jorge Alcalá
Added: Sep 19, 2018 12:18 AM
Modified: Oct 22, 2018 11:11 PM
Views: 3456
Tags: t_query
  1. $consulta = 'SELECT MAX(%s) AS max FROM %s WHERE clacliente = ' . $cliente;
  2.                         $consulta = sprintf($consulta, DocumColectivosAdjuntosPeer::NUMERO, DocumColectivosAdjuntosPeer::TABLE_NAME);
  3.                         $sentencia = $conexion->prepareStatement($consulta);
  4.                         $resultset = $sentencia->executeQuery();
  5.                         $resultset->next();
  6.                         $numero = $resultset->getInt('max') + 1;