5
Contributors
10
Replies
11
Views
6 Years
Discussion Span
Last Post by evanism
0

Hello all,
Is there any way that I can count the number of lines in one column in a table? Such as I want to count all the names in this column on First name:
http://www.globalvirtualairlines.com.../web%20app.php

How would I do so?
Thanks in advance!

that's a dead link but I assume that you are talking about an html table with which you will need to loop through the Dom to get a count. I suggest you search google with "javascript count table cells" and will probably find someone who has already done it with an already made example of how it can be done.

0

is this your website or will be using a file_get_contents or curl or something like that?

0

No this is not my website. I am planning to use this as a web addon.
and i am not familiar with file_get_contents.

The reason I ask about column counting is because I had an Idea to make an Invisible table and use just one column, count the column contents as in count each line in the single Column.
And on the top of the page have one table with a row displaying how many First Names there are.

0

so how do you plan to pull in the html from this page? Or is that one of your questions?

0

Use this query to count single column from table

SELECT COUNT( FIRSTNAME ) FROM TABLE;
0

Interesting. Use some jquery by using DATATABLES it is a bit of a curve, but I learned it in 2 days.... http://www.datatables.net/examples/basic_init/zero_config.html

By typing what you need into the box you can get an exact extract of your entire list.

It is not hard, and is well worth learning, PLUS it is dynamic.

ok, and how do you plan to get around the cross domain ajax rule without using some type of JSON exchange?

0

R0bb0b, no cross domain stuff needed, its all on his site, I assumed some sort of pre-harvesting is ocuring and 1) he already has the data, and 2) it is just being burped out.

Re-reading the question and thinking about tamsofts response, perhaps the poster is looking for something like this:

SELECT distinct( FIRSTNAME ), COUNT( FIRSTNAME )
FROM tablename
group by FIRSTNAME;

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.