What is more efficient - using mysql_num_rows or COUNT(key) -php+mysql

This is a discussion on What is more efficient - using mysql_num_rows or COUNT(key) -php+mysql within the MySQL Database forums, part of the Database Forums category; As in the subject - what is more efficient way to get number of affected rows - using mysql_num_rows or just ind ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-14-2008
krzys
 
Posts: n/a
Default What is more efficient - using mysql_num_rows or COUNT(key) -php+mysql

As in the subject - what is more efficient way to get number of
affected rows - using mysql_num_rows or just ind the query SELECT
COUNT(key) FROM tabale WHERE='conditions'? Which one is quicker?

Best regards,
Krzysiek
Reply With Quote
  #2 (permalink)  
Old 01-14-2008
Captain Paralytic
 
Posts: n/a
Default Re: What is more efficient - using mysql_num_rows or COUNT(key) -php+mysql

On 14 Jan, 08:39, krzys <kr...@iarp.pl> wrote:
> As in the subject - what is more efficient way to get number of
> affected rows - using mysql_num_rows or just ind the query SELECT
> COUNT(key) FROM tabale WHERE='conditions'? Which one is quicker?
>
> Best regards,
> Krzysiek

mysql_num_rows will not give you a number of affected rows.
Rows are "affected" by running a INSERT, UPDATE, REPLACE or DELETE
query (two of which do not take a WHERE clause).
mysql_num_rows is a side efect of runing a SELECT query. SELECT
queries do not "affect" rows.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0