while ($row=mysql_fetch_row($result))
{
echo "1 $row[0]"
for($x=1; $x<count($row); $x++) 
if(!empty($row[$x])) 
{
echo $x+1;
echo " ".$row[$x];
}
}


Op donderdag 28 februari 2002 14:40, schreef DARCY,MATTHEW 
(Non-HP-UnitedKingdom,ex2):
> Hello PHP'ers.
>
> First of all - scince joining this list I have got some great help and it
> is really helping my build me site so a BIG thank you to all.
>
> Now back to the help..........
>
> I have a table with cols, and say 20 rows in this table.
>
>
> col: 1        2       3       4       5       6       7       8       9       10
> row: notnull          stuff   4               test    blah    duh     dud
>      notnull  stuf            blah    blah    test            duh     dud
>
>
> as you can see col 1 is ALWAYS populated as it is notnull the rest
> are/aren't populated.
>
> I want to search on this table (in real life it has hundreds of rows)
>
> so select * from testable;
>
> I then want to generate a HTML table in php DEPENDING on how many rows are
> populated
>
> so for example the table for row 1 would look like this
>
> 1     notnull
> 4     stuff
> 5     4
> 7     test
> 8     blah
> 9     duh
> 10    dud
>
> while row 2 would look
>
> 1     notnull
> 3     stuff
> 5     blah
> 6     blah
> 7     blah
> 9     duh
> 10    dud
>
> I am thinking I would have to do some sort of while loop on an array of all
> fields, but how would I single out the null fields in the array and
> generate everything else ????
>
> thanks
>
> Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to