|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/connect-to-mysql-db-using-pdo/
课程评论:没有评论
**课程总结:PDO & MySQL:使用 PDO 连接 MySQL 数据库及 CRUD 操作** 本课程旨在教授学员如何使用 PHP Data Objects (PDO) 连接并操作 MySQL 数据库。课程内容涵盖以下要点: * **PDO 连接 MySQL**: 学习如何建立与 MySQL 数据库的连接。 * **PDO 数据库封装类**: 掌握如何正确编写 PDO 数据库封装类及其方法,以实现代码的复用和标准化。 * **PDO CURD 操作**: 学习如何在数据库中执行创建(Create)、读取(Read)、更新(Update)和删除(Delete)等基本操作。 * **`PDO::rowCount()` 的正确使用**: 深入理解 `rowCount()` 函数的正确用法,纠正常见的误用。 * **PDO 查询编写**: 学习如何编写简单和复杂的 SQL 查询语句,包括带参数的查询。 * **数据提取**: 掌握多种从数据库语句中提取数据的方法,如 `foreach` 循环、`fetch()`、`fetchAll()`、`fetchColumn()` 等。 * **错误处理与异常**: 学习如何使用 PDO 进行有效的错误处理和异常管理。 * **获取受影响行数和最后插入 ID**: 了解如何获取 SQL 操作影响的行数以及最后一次插入操作的 ID。 * **`LIMIT` 子句在预处理语句中的问题**: 探讨 `LIMIT` 子句在 PDO 预处理语句中的潜在问题。 * **方法链式调用与通用函数**: 学习如何编写简洁、可重用且安全的 PHP 代码,包括编写通用函数和使用方法链式调用。 本课程适合希望掌握使用 PDO 进行数据库交互的 PHP 开发人员,旨在帮助您写出更精简、更安全、更具可维护性的代码。
Do you want to know how to connect to MySQL Database using PDO?Do you want to know how to write PDO Database Wrapper Class and methods the proper way?Do you want to know how to do CRUD operations with PDO?Do you want to know how to use the rowCount() function the proper way? Note that is the most misused function among PHP PDO developers.Do you want to know how to write simple and complex queries with PDO?Do you want to be able to write slim, concise, reusable and secure code?If your answer to all these is Yes, Then this course is for you.In this short course, you are going to learn, practice and do some hands-on exercises on how to: Connect to MySQL Database using PDOWrite your first PDO Database Wrapper class Write PDO CRUD methods (i.e. function in a class) Write simple queries - queries without parameters Write secure queries with parameters Get data out of statements - using foreach, fetch(), fetchAll(), fetchColumn() Error handling and Exceptions PDO::rowCount() function explained Get affected rows and last insert Id The problem with Limit Clause in prepare statements Write a simple general function and chaining methods