By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,743 Members | 1,780 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,743 IT Pros & Developers. It's quick & easy.

get rows in mysql at command prompt

P: n/a
This question really belongs more in a mySQL group, but my NNTP server
doesn't have a mySQL group available. Sorry. =(

I'm trying to get number of rows in a table without doing a "select * from
table" or even a "select id from table". I know in PHP you put:
mysql_numrows()
but what's the equivelant in command prompt?
I searched mysql.net and can't find anything.

Thanks for any advice!
Liam
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
*** Mechphisto wrote/escribió (Mon, 12 Apr 2004 15:49:42 GMT):
I'm trying to get number of rows in a table without doing a "select * from
table" or even a "select id from table".


SELECT COUNT(*) FROM table

It's standard SQL, works in any DBMS.
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #2

P: n/a
"Alvaro G Vicario" <al******************@telecomputeronline.com> wrote in
message news:1i*******************************@40tude.net. ..
*** Mechphisto wrote/escribió (Mon, 12 Apr 2004 15:49:42 GMT):
I'm trying to get number of rows in a table without doing a "select * from table" or even a "select id from table".


SELECT COUNT(*) FROM table


Thank you very much!! Saves me a lot of problems! =)
Liam
Jul 17 '05 #3

P: n/a

On 12-Apr-2004, "Mechphisto" <li**@REEMOVEmechphisto.net> wrote:
This question really belongs more in a mySQL group, but my NNTP server
doesn't have a mySQL group available. Sorry. =(

I'm trying to get number of rows in a table without doing a "select * from
table" or even a "select id from table". I know in PHP you put:
mysql_numrows()
but what's the equivelant in command prompt?
I searched mysql.net and can't find anything.


try "SHOW TABLE STATUS LIKE 'tablename'" look at the column named 'Rows'

--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #4

P: n/a

"Mechphisto" <li**@REEMOVEmechphisto.net> wrote in message
news:qUyec.22780$rg5.40320@attbi_s52...
This question really belongs more in a mySQL group, but my NNTP server
doesn't have a mySQL group available. Sorry. =(

<snip>

Does it have alt.php.sql?

Garp
Jul 17 '05 #5

P: n/a
"Garp" <ga***@no7.blueyonder.co.uk> wrote in message
news:yz*********************@news-text.cableinet.net...

"Mechphisto" <li**@REEMOVEmechphisto.net> wrote in message
news:qUyec.22780$rg5.40320@attbi_s52...
This question really belongs more in a mySQL group, but my NNTP server
doesn't have a mySQL group available. Sorry. =(

<snip>

Does it have alt.php.sql?


No, afraid not. =/
Jul 17 '05 #6

P: n/a

"Mechphisto" <li**@REEMOVEmechphisto.net> wrote in message
news:jRCec.21842$wP1.44082@attbi_s54...
"Garp" <ga***@no7.blueyonder.co.uk> wrote in message
news:yz*********************@news-text.cableinet.net...

"Mechphisto" <li**@REEMOVEmechphisto.net> wrote in message
news:qUyec.22780$rg5.40320@attbi_s52...
This question really belongs more in a mySQL group, but my NNTP server
doesn't have a mySQL group available. Sorry. =(

<snip>

Does it have alt.php.sql?


No, afraid not. =/


Don't worry about it, it's low traffic (and not really a great idea either).
Everyone else posts MySQL questions here, anyway...

Garp
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.