Loop through each cell in a table and get its respective title

Vishnu

Below is the example of my table.I know its bad ..some website provided data like this.I need to convert to some better format.

enter image description here

So I want to loop through all cells and get its respective title.

for example output should be like..

01001 - Dairy and Egg Products
01002 - Dairy and Egg Products
.
.
.
.
02001 - Spices and Herbs
02002 - Spices and Herbs

My code so Far in php , I am sorry I searched in stackoverflow and google I am unbale to find answer and I have no Idea how to do it.Some help is appreciated.

$qrelated= inputs("SELECT * FROM `table`");

while($row = $qrelated->fetch_assoc())
{

}
AeroX

You can use a foreach loop to print out each column heading and it's value for each row using something like this:

foreach($row as $key => $value) {
    echo $value." - ".$key;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Loop through each cell

From Dev

loop through each column of a table

From Dev

Loop through each cell in a selected range

From Dev

Loop through column of tableview and get cell data

From Dev

Prepend each element to its respective adjacent element

From Dev

loop through each row in table value parameter

From Dev

Loop through each row in a table for a given range

From Dev

Loop through an HTML table using Razor/C# to get the data in each <tr>

From Dev

Get first cell value of each row in table

From Dev

excel (2010) - loop through each cell in a Range and draw an oval

From Dev

Jquery loop through each cart and grab the data of its class

From Dev

Loop through each element with class and append its text JQUERY

From Dev

Tableview cell is reloaded multiple table cell each time when its loaded

From Dev

How to put data of each month in its respective monthly column

From Dev

Loop through each column of first row in table with JQuery

From Dev

Loop through each ID with more than 3 records in the same table

From Dev

Loop through each table row and swap two cells

From Dev

Loop through each ID with more than 3 records in the same table

From Dev

how to process json data through an .each loop into html table

From Dev

How to get HTML Table Cell Value through JQuery?

From Dev

need to Iterate through the cells in the array, and set the value of each cell to be the product of its coordinates

From Dev

Get cell by its content

From Dev

get the content of one column of each row in the table and then loop on each content

From Dev

Get object value through a click event after each loop

From Dev

jquery to get each and every row of table and rename its name attribute

From Dev

Is it possible to fatch each data in single loop and store in respective array?

From Dev

GET JournalArticle with Id and its Title

From Dev

Iterating through table and get the value of a button in each tablerow jQuery

From Dev

How can I get a div and all its children with their respective computedStyles?

Related Related

  1. 1

    Loop through each cell

  2. 2

    loop through each column of a table

  3. 3

    Loop through each cell in a selected range

  4. 4

    Loop through column of tableview and get cell data

  5. 5

    Prepend each element to its respective adjacent element

  6. 6

    loop through each row in table value parameter

  7. 7

    Loop through each row in a table for a given range

  8. 8

    Loop through an HTML table using Razor/C# to get the data in each <tr>

  9. 9

    Get first cell value of each row in table

  10. 10

    excel (2010) - loop through each cell in a Range and draw an oval

  11. 11

    Jquery loop through each cart and grab the data of its class

  12. 12

    Loop through each element with class and append its text JQUERY

  13. 13

    Tableview cell is reloaded multiple table cell each time when its loaded

  14. 14

    How to put data of each month in its respective monthly column

  15. 15

    Loop through each column of first row in table with JQuery

  16. 16

    Loop through each ID with more than 3 records in the same table

  17. 17

    Loop through each table row and swap two cells

  18. 18

    Loop through each ID with more than 3 records in the same table

  19. 19

    how to process json data through an .each loop into html table

  20. 20

    How to get HTML Table Cell Value through JQuery?

  21. 21

    need to Iterate through the cells in the array, and set the value of each cell to be the product of its coordinates

  22. 22

    Get cell by its content

  23. 23

    get the content of one column of each row in the table and then loop on each content

  24. 24

    Get object value through a click event after each loop

  25. 25

    jquery to get each and every row of table and rename its name attribute

  26. 26

    Is it possible to fatch each data in single loop and store in respective array?

  27. 27

    GET JournalArticle with Id and its Title

  28. 28

    Iterating through table and get the value of a button in each tablerow jQuery

  29. 29

    How can I get a div and all its children with their respective computedStyles?

HotTag

Archive