Send select to print with php

0

I need to dynamically create a table with "n" rows and then send this table to print, but not succeeding, the table construction looks like this:

    // laço para buscar e-mail e efetuar envio
foreach($checkboxes as $id) {

    // deletando registro do candidato
    mysql_select_db($database_conCurriculo, $conCurriculo);
    $query_rsRegistro = "SELECT * FROM candidato WHERE id_candidato = $id ";
    $rsRegistro = mysql_query($query_rsRegistro, $conCurriculo) or die(mysql_error());
    $row_rsRegistro = mysql_fetch_assoc($rsRegistro);
    $totalRows_rsRegistro = mysql_num_rows($rsRegistro);
    $status = $rsRegistro;

   $impressao =  " <table width='100%' border='1'>
        <tbody>
          <tr class='new-record-row' style='display: none;' data-new-row='false'>
            <td colspan='7' data-column-name='sm_multi_delete_column'></td>
          </tr>
          <tr class='pg-row' style=''>
            <td class='data-operation' >{$row_rsRegistro['nome']}</td>
            <td class='data-operation' data-column-name='edit' >implode('-', array_reverse(explode('-', {$row_rsRegistro['dt_nascimento']})));</i></td>
            <td data-column-name='ID' >implode('-', array_reverse(explode('-',{$row_rsRegistro['dt_atualizacao']})));></td>
            <td data-column-name='ID' >{$row_rsRegistro['endereco']}; ?></td>
            <td data-column-name='Nome'>{$row_rsRegistro['id_municipio']}; ?>
            <td colspan='2' style='' data-column-name='DataCadastro'>{$row_rsRegistro['id_uf']}; ?></td>
          </tr>
        </tbody>
    </table>";


} // fim do foreach

How can I mount it and send it to print?

    
asked by anonymous 27.06.2014 / 21:22

1 answer

1

I use while to generate the select dynamically, I hope the example below will help you:

<?php
$select = pg_query($conexao, $sql->menu_logado($entidade));

echo "<select name=\"codseg\" onChange=\"document.forms['segmentos'].submit();\">";

echo "<option>SELECIONE</option>";

echo "<option value=''>TODOS</option>";

while ($segmento = pg_fetch_array($select)) {

    $cod = $segmento['segcodseg'];

    $descricao = str_replace("/", " / ", $segmento['segdesseg']);

    $c = '';

    if ($selecionado == $cod) {

        $c = ' SELECTED';

    }

    echo "<option value='".$cod."' $c>".$descricao."</option>";

}

echo "</select>";
    
27.06.2014 / 21:30