Problem with MySQL table

Help
Anonymous
2011-06-13
2013-05-15

  • Anonymous
    2011-06-13

    Hi, I've followed the (fantastic) example of how to get a dynamic table from
    MySQL but I've hit a small snag. Every time I output the list I lose the very
    first record no matter how many we retrieve.

    Can anyone tell me what am I doing wrong in this code please?

        case "table1":
            $html = '<table border="1" cellpadding="0" cellspacing="0">
                        <tr>
                            <td style="background-color: #C0C0C0; color: #FFFFFF; width:80px; text-align:center; ">Record No:</td>
                            <td style="background-color: #C0C0C0; color: #FFFFFF; width:120px; text-align:center;">Site Name:</td>
                            <td style="background-color: #C0C0C0; color: #FFFFFF; width:140px; text-align:center;">Department / Site:</td>
                            <td style="background-color: #C0C0C0; color: #FFFFFF; width:300px; text-align:center;">Activity:</td>
                            </tr>';
    
                    while($row_ListRecordset = mysql_fetch_array($ListRecordset)) {
                        $id = $row_ListRecordset['RecordNo'];
                        $data_one = $row_ListRecordset['SiteName'];
                        $data_two = $row_ListRecordset['Department'];
                        $data_three = $row_ListRecordset['Activity'];
    
            $html=$html.'<tr>
                            <td style="width:80px; text-align:center;">'.$id.'</td>
                            <td style="width:120px; text-align:center;">'.$data_one.'</td>
                            <td style="width:140px; text-align:center;">'.$data_two.'</td>
                            <td style="width:300px; text-align:center;">'.$data_three.'</td>
                        </tr>';
    
            }
    
            $html = $html.'</table>';
        break;
    
     
  • Frank Baltus
    Frank Baltus
    2013-05-15

    Try to remove mysql_fetch_assoc($ListRecordset)

     
  • Frank Baltus
    Frank Baltus
    2013-05-15

    I see the requested info on my pdf but no lines and i just wont to see the lines on the PDF.

    Where did i go wrong?

    $html = '




    ';

    while($row_RS_aanbieding = mysql_fetch_array($RS_aanbieding)) {
    $id = $row_RS_aanbieding['Weeknummer'];
    $data_one = $row_RS_aanbieding['Koopman_id'];
    $data_two = $row_RS_aanbieding['Aanbieding'];

    $html=$html.'





    ';

        }
    

    $html = $html.'';

    mysql_free_result($RS_aanbieding);

    Weeknr: Logo: Aanbieding:
    '.$id.' '.$data_one.' '.$data_two.'

     
    Attachments