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.

4
  • 2
    Check to see if they defined their own functions as wrappers Commented Jan 21, 2014 at 21:18
  • Maybe you didn't search too long. Commented Jan 21, 2014 at 21:19
  • 1
    @sircapsalot: "because mysql_numrows is not a function" --- is not a built-in function Commented Jan 21, 2014 at 21:20
  • 1
    Try this to find out where is it: [How to find out where a function is defined][1] [1]: stackoverflow.com/questions/2222142/… Commented Jan 21, 2014 at 21:22

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

Comments

4

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

Look at the following documentation - https://www.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!

1 Comment

Thank you so much for clarifying this. This is what I assumed, but didn't notice this note in the documentation.
1

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

2 Comments

That's msql_, not mysql_.
Ya that I found that one relatively quickly, but I am using mysql which has been pointed out

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.