Suggest a feature
×

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
Views: 2
Tags: t_query
  1. $consulta = 'SELECT MAX(%s) AS max FROM %s WHERE cladocumcolectivo = ' . $claDocumento;
  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;