TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Accessing databases with PHP?

2 点作者 shire将近 11 年前
What&#x27;s is the preferred method for connecting with a database in PHP in 2014? I realize things move fast in the tech industry and there are always new updates and fixes happening but when building a websites in our era which is the best way to do.<p>Mysql, Mysqli or PDO?

2 条评论

trebor将近 11 年前
MySQL is deprecated and outright removed in PHP 5.5, so MySQLi is your fallback option instead. However, PDO is the best choice.
评论 #8016113 未加载
Spoom将近 11 年前
Were I to choose one for a new project now, I would probably go with PDO simply because of its generic nature and support for prepared queries with parameter replacement. Mysqli apparently has this too but bind variables are somewhat difficult to use with the mysqli extension.