freeCodeCamp/guide/chinese/php/working-with-databases/index.md

13 lines
903 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Working With Databases
localeTitle: 使用数据库
---
## PHP可以使用哪些选项来连接数据库
PHP可以连接到各种不同的数据库包括MongoDBMsSQL和MySQL。 PHP和MySQL都很受欢迎并提供简单免费和开源的网站 要创建并经常一起创建所有类型的网站。 PHP和MySQL都可以扩展以支持大量用户。
PHP甚至支持多种方式来处理与MySQL的连接包括MySQLi Procedural PHP数据对象PDO和MySQLi对象与现已弃用的MySQL Connect一起定位。 使用PHP该语言的核心功能内置了许多功能可以链接到 数据库简单易行。
Mysqli的一些例子是 -
connect“localhost”“root”“”“db name”或die“无效的用户或密码......无法连接”); > 这里我们连接到phpmyadmin结构上的数据库没有密码和数据库名称-db\_name