If all mysql operations are encapsulated into a stored procedure, is it okay?
If a website encapsulates all database operations into a stored procedure,
Is it easier for future maintenance than simply writing SQL statements in the program?
Reply to discussion (solution)
Stored procedures, as long as the database does not have problems, basically there will be no problems.
That is to say, in terms of security, the system that uses stored procedures is more stable.
We also need to know that the biggest problem with the stored procedure is poor portability. if the landlord ignores this aspect, we can consider using
In fact, we don't need to encapsulate a common PHP file for database operations.
Stored procedures, as long as the database does not have problems, basically there will be no problems.
That is to say, in terms of security, the system that uses stored procedures is more stable.
We also need to know that the biggest problem with the stored procedure is poor portability. if the landlord ignores this aspect, we can consider using
In fact, we don't need to encapsulate a common PHP file for database operations.
Thank you for your reply.
I feel that if stored procedures are encapsulated, the query syntax in php is very simple. I use ezSQL for access, just write $ db-> get_results ("call storeproecdure ('$ xxx')") to something similar.
SQL statements become simple and clear ..
Portability .. Well, I didn't think about it.
Why is portability poor?