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:10 PM, Chris Stankevitz at chris <email protected> wrote:

>
> Jesse,
>
> You bring up a good point! I forgot about that and should have been more
> specific.
>
> If the first row has [first_name = null], then the first_name column will
> not show up. Even if the other 99 rows have first_name. No column heading,
> nothing. The column disappears.
>
> OTOH, if the first row contains data in the dob_dt column while the other 99
> have [dob_dt = null], the column *is* displayed, with a heading, and the
> other rows simply get an empty cell.
>
> If no one out there has seen this, or if people agree that this does not
> happen for them, i'll assume it's something lame i'm doing which will go
> away soon :)
>
> Chris
>
> At 06:36 AM 7/16/2000 -0400, Jesse Swensen wrote:
>> 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>

Do you feel this has something to do with the table class or do you think it
is an HTML type problem?

-- 
Jesse Swensen
swensenj <email protected>

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