This How To Video introduces how to connect and query MySQL databases from PHP using the PDO (PHP Data Objects) API. We see that multiple databases can be accessed in the same script by using 2 PDO connection objects. We use prepared statements to minimize potential SQL Injection. We also demo the bindColumn() method to populate the PHP variable with the table value based on the FETCH_BOUND attribute of the fetch() method. We also se the difference between the FETCH_ASSOC and FETCH_NUM properties of the fetchAll() method. The rowCount() method is used to see the number of rows returned with the fetchAll() method.The test databases are running locally on a XAMPP server. Questions or comments please let me know - Dave at DaveCoast.com. Thanks for Watching.
No comments:
Post a Comment