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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.