0

I am working on a PHP project. This project is using mysql_fetch_array many places.

now. I want to sanitize data. So I want that after php function mysql_fetch_array is called. My function to sanitize data should be called. I don't want to call my function in each of its call. because this call will be at more than 400 places.

Is there any way to achieve this?

1
  • 1
    Rewrite PHP core; or perhaps switch to using MySQLi or PDO with prepared statements/bind variables; or create a wrapper for your queries Commented Sep 13, 2013 at 21:48

1 Answer 1

2

You can't amend the PHP core functions because your project will not work under other php versions.

A good approach is to find & replace "mysql_fetch_array()" to your function in whole project then add what you want :)

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

2 Comments

Actually we dont want change in many files. Because it requires testing of all that changes.
Already you need to test all affected places. and there no ability to change or overwrite php built in functions

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.