Re: [phplib] Table widget hides columns with null first row value From: Jesse Swensen (swensenj <email protected>)
Date: 07/16/00

on 7/16/00 3:02 AM, Chris Stankevitz at chris <email protected> wrote:

> <?php
> require("table.inc");
>
> $q = new DB_Lobo;
> $t = new Table;
>
> $q->query("SELECT * FROM lobo;");
> $t->show_result($q);
> ?>
>
> This query (mysql) returns about 100 rows, with columns like first_name,
> homepage_url, primary_email, etc. Only those columns whose values are not
> null in the first row appear! (Verified with different queries.) My mysql
> client shows all the columns, so I assume PHPLib is getting them.

This may be more of a HTML table thing. If you don't put anything in the
table cell, it is not displayed. No border, etc... So, try this:

$sql = "
    SELECT
        IFNULL(col1, '&nbsp;'),
        IFNULL(col2, '&nbsp;'),
        IFNULL(col3, '&nbsp;')
    FROM
        lobo
";

$q->query($sql);

This will put a non breaking space (nbsp) in the cell if colx is null,
otherwise colx.

Hope I have understood the problem and this helps...

-- 
Jesse Swensen
swensenj <email protected>

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>