4

Please redirect me if this question has already been answered.

I have been managing a legacy system, and I have noticed they use the call mysql_numrows instead of mysql_num_rows. I have spent a decent amount of time searching for documentation on these calls, but have turned up nothing. The system works fine, and I have found no evidence of custom functions for this.

Does anyway know whether this is a deprecated function from an older version of PHP? When I am adding to the system I use mysql_num_rows, which as works fine.

Yes I know that mysql_* is outdated and the system should be updated, but that is beyond the scope of my services. I am mainly just curious why this works? Thanks.

Strawberry
  • 33,750
  • 13
  • 40
  • 57
aray12
  • 1,833
  • 1
  • 16
  • 22

3 Answers3

7

mysql_numrows is a deprecated alias for mysql_num_rows.

For backward compatibility, the following deprecated alias may be used: mysql_numrows()

Found it here.

Florian Bussmann
  • 436
  • 3
  • 10
4

mysql_numrows() is an alias for mysql_num_rows() used for backward compatibility.

Look at the following documentation - http://us1.php.net/mysql_num_rows

For backward compatibility, the following deprecated alias may be used: mysql_numrows()

Hope this helps clarify your question.

I'd suggest using mysql_num_rows() where possible, in case this backward compatibility will be ignored in future versions.

Cheers!

dev7
  • 6,259
  • 6
  • 32
  • 65
  • Thank you so much for clarifying this. This is what I assumed, but didn't notice this note in the documentation. – aray12 Jan 23 '14 at 21:09
1

Thats an alias of mysql_num_rows. See PHP documentation http://www.php.net/manual/en/function.msql-numrows.php

tnash
  • 385
  • 4
  • 12