Is there a way of using functions defined in PHP in mysql? Please help.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes there is a way to accomplish what you are talking about. They are called “Stored Procedures” and you can create one using PHP and then store it on MySQL Server, this way the execution of the function will my the MySQL server’s responsibility instead of the PHP Engine.
Here is a link to the MySQL documentation on Stored Procedures:
Stored Procedures ,
Another article on Stored Procedures ,
Using Stored Procedures ,
I don’t know if this answers your question, but I figured I would give it a shot.
EDIT: Check out my comments on Tudor Constantin’s answer, you CAN write stored procedures to the database using a PHP MySQL query! The stored procedures get placed in the mysql database in the “proc” table on the mysql server.
h