Re: number of rows in mysql...

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

 



In message <20060729131231.76526.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, z.
shafiee <z.shafiee@xxxxxxxxx> writes
>WROTE:"This table has a column which contains the rows - the
>number of records - for each table. This means that you only get one
>field back."
>  is there any way to access this field? (exept "select * count...)
>  can u give me ur email?

The correct way to access it is
SELECT count(*) FROM table

If you don't want to use a SELECT, how do you think that you can reach
any data?

I really do not understand why you do not want to use the correct,
professional way.  Is there something that you have not told us?

I pressed [SEND] by mistake.

The WRONG way to do this is:
SELECT TABLE_ROWS FROM information_schema.TABLES WHERE
TABLE_SCHEMA='databasename' AND TABLE_NAME='tablename';

You will require permissions to access this data, which you should not
be giving to web pages.  If you are using shared hosting, this will not
be available to you.  This is very bad security.

SELECT count(*) FROM table
is simpler, safer, and more professional.



-- 
Pete Clark

Andalucia in Sunny Southern Spain
http://www.hotcosta.com/comm_1.htm



PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux