How to handle elements of an array individually?

0

Greetings, gentlemen,

I'm trying to design a portal where my clients can view their invoices, statements and invoices. As you can see, everything is fine, but you're almost ready to do what I need. Below is the PHP code and how do I make the information "invoice" of the database could become a link (for viewing and downloading a file). The problem arises when I try to do the same with the "reserve" object.

As there will always be multiple reservations per invoice, MySQL extracts this information as a line. I need to manipulate every number present in it, but everything I try only affects my line as a whole.

Here is a link to a previous question explaining the use of group_concat in this case: link

Page Result:

<?php$mysqli=NEWMySQLi('localhost','root','','server');$sqlFatura=$mysqli->query("SELECT login as NOME,fatura AS  
Fatura, Emissao, Vcto, group_concat(reserva) AS RESERVAS
FROM usuarios INNER JOIN faturas,anexos WHERE 
usuarios.ID=IDlogin AND faturas.ID=IDfatura AND login='". 
mysql_real_escape_string($_SESSION['login'])."' GROUP BY fatura");


if($sqlFatura->num_rows > 0){
    while($rows = $sqlFatura->fetch_assoc()){
        $fatura = $rows['Fatura'];
        $loc = $fatura .".pdf";
        $stur = $rows['RESERVAS'];
        $emissao = $rows['Emissao'];
        $vcto = $rows['Vcto'];

    echo "<p> Fatura $fatura Emitida dia $emissao Vencimento
    $vcto=><a href='$loc' target='_blank'>DOWNLOAD</a>  ANEXO: $stur<br></p>";

}
}else{
echo "SEM FATURAS.";

}

?>

Thanks in advance for the help and for any clarifications just get in touch.

Att,

    
asked by anonymous 28.08.2016 / 19:32

1 answer

0

Well if I understand your doubt add this to the code and should work:

 echo "<p> Fatura $fatura Emitida dia $emissao Vencimento
       $vcto=><a href='$loc' target='_blank'>DOWNLOAD</a>  
           ANEXO:<a href='url_stur' target='_blank'>$stur</a><br></p>";
    
29.08.2016 / 02:06