I created a table, where I put the user's registration on a card for printing; so this table has several records (5 per page) and for each page I access a record in the same table I made an array_push with values ->
$sql = mysql_query("SELECT * FROM cartao LIMIT $inicial, $numreg ");
$sql_conta = mysql_query("SELECT * FROM cartao ");
$quantreg = mysql_num_rows($sql_conta);
$Nascimento = array();
$Batismo = array();
$Comunhao = array();
$Emissao = array();
while($linha = mysql_fetch_array($sql_conta, MYSQL_ASSOC)){;
array_push($Nascimento, $linha['Nascimento']);
array_push($Batismo, $linha['Batismo']);
array_push($Comunhao, $linha['Comunhao']);
array_push($Emissao, $linha['Emissao']);
}if ($_GET['pag'] > 0 ){
$pegaid = (int) $_GET['pag'];
$id = "$pegaid";
$soma = $id * 5 ;
}
Inside the Table I pull the log data that comes out in format ('yyyy / mm / dd') the table works like this:
td height="42"><a>Nascimento:</a>
<?php
echo '<b>';
if ($_GET['pag'] > 0 ){
print $Nascimento[0 + $soma];
}else{
print $Nascimento[0];
}
echo '</b>';
?>
</td>
I wanted to KNOW how to invert the format without giving a problem in the rest of the code the other records I took to find it of no importance. OBS :. All records there are dates; The registration record is an automatic registration !!! Someone help me.