WAMFT1 Posted June 4, 2020 Share Posted June 4, 2020 I have to start work on upgrading my work site and wonder whether to go SQLI or PDO? I don't know either so which would be easier to learn? I may need some help to get some things working properly. Any tips or tricks would be appreciated. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted June 4, 2020 Share Posted June 4, 2020 see this reply - On 11/13/2019 at 11:46 AM, mac_gyver said: if you are faced with updating old code that uses the mysql extension, do yourself a favor and 1) jump directly to use the very simple and future-proof PDO extension, 2) use prepared queries when supplying external/unknown data to an sql query statement (this actually simplifies the sql query syntax), 3) using implicate binding (supply an array of values to the execute call) for prepared queries, and 4) use exceptions for errors and in most cases let php catch and handle the exception where it will use its error related settings to control what happens with the actual error information (database errors will 'automatically' get displayed/logged the same as php errors.) doing these four things greatly simplifies the implantation of your database specific code, which will let you eliminate, rather than convert code, shortening the task. Quote Link to comment Share on other sites More sharing options...
WAMFT1 Posted June 4, 2020 Author Share Posted June 4, 2020 Thanks mac_gyver. I will do some quick research on how to use PDO and try and update what I have. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.