Código HTML:
Folio:<input name="folio" id="nombrecaja" type="text" class="input3" size="15" value="<? mysql_select_db($database_connection, $connection);
$ultimo1=mysql_query("SELECT MAX(folio) ultimo FROM registro Where id=".$row_abc['id'] );
$ultimo = mysql_fetch_assoc($ultimo1);
$ultimo2=mysql_query("SELECT folio as ultimo FROM registro Where id=".$row_abc['id'] );
$ultimo = $ultimo['ultimo'];
if (mysql_num_rows($ultimo2) == 1) {
echo $ultimo;
}
else {
echo $ultimo+1;
}
?>" />
Código PHP:
echo " <td>Folio:<input name='folio' id='nombre' type='text' size='15' value='mysql_select_db($database_connection, $connection);
$ultimo1=mysql_query("SELECT MAX(folio) ultimo FROM registro Where id=".$row_abc[id] );
$ultimo = mysql_fetch_assoc($ultimo1);
$ultimo2=mysql_query("SELECT folio as ultimo FROM registro Where id=".$row_abc[id] );
$ultimo = $ultimo['ultimo'];
if (mysql_num_rows($ultimo2) == 1) {
echo $ultimo;
}
else {
echo $ultimo+1;
}
' /> </td>";