Jump to content

[SOLVED] Select columns by number


mcky

Recommended Posts

Basically I'd like to create a while loop to make rows in a HTML table.

 

The columns I want to use are from 11-30 (all different names obviously) in table 'stats'. All of them have a value, but if their value is 0, I don't want that column to become a row in the HTML table.

 

Now instead of going through each column individually, is there a way I can use some sort of loop to create the rows using the column numbers instead of name?

 

eg.

 

If column11 = 50, column12 = 30, column 13 = 0, column 14 = 70, the HTML table would look similar to

 

column11
column12
column14
50
30
70

 

Thanks.

 

Link to comment
https://forums.phpfreaks.com/topic/110299-solved-select-columns-by-number/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.