Re: Row count in a query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shaun wrote:

Is it possible to have an incrementing row count in my query that is not
part of the table data?

i.e.

1  data  data
2  data  data
3  data  data
...

This has to be done in the query not the PHP!!

If you _have_ to get this in your query I'd say you have a flaw in your logic somewhere. However, you can do it in MySQL using these two queries.


SELECT @a:=0;

SELECT @a:=@a+1, * FROM table;

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux