jimfog Posted August 4, 2013 Share Posted August 4, 2013 (edited) I am using COUNT to see how many rows exist in a specific table. My question is how am I going to print the result in the browser since in such a case the query returns only a number and not a specific row which I could get with fetch object or something similar. Thanks Edited August 4, 2013 by jimfog Link to comment Share on other sites More sharing options...
justsomeguy Posted August 5, 2013 Share Posted August 5, 2013 All queries return a result set, they do not return individual values. Give the value an alias and use that as the column name. By default the column name is the entire function. Link to comment Share on other sites More sharing options...
jimfog Posted August 6, 2013 Author Share Posted August 6, 2013 Give the value an alias and use that as the column name. Can you give me an example? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 6, 2013 Share Posted August 6, 2013 SELECT COUNT(...) AS alias FROM ... http://www.w3schools.com/sql/sql_alias.asp Link to comment Share on other sites More sharing options...
jimfog Posted August 6, 2013 Author Share Posted August 6, 2013 I really had no idea you were talking about this...which by the way is completely unfamiliar to me. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now