Thread: count question
View Single Post
Old 02-22-2013, 07:11 PM   PM User | #7
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,468
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by durangod View Post
And it also looks like i dont even have to worry about extra elements on the result other than [0] because from what i gather from the docs it defaults to [0] and thats all i need as i am not repeating this in a loop so it will always be just [0] result on this.
Yes - because your query is only retrieving a single value per row. If you were retrieving a second field from the table in the same query the it would be in [1].

Even if you were returning multiple rows the count would be in [0] for every row when processing inside the loop.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote