Ruby on Rails 与 MySQL、PHP 和 javascript 方法有何不同?

发布于 2024-10-10 03:36:00 字数 305 浏览 0 评论 0原文

我刚刚读到 Robin Nixon 写的《学习 PHP、javascript 和 MySQL》,第一句话指出:

“PHP 和 MySQL 的组合是动态、数据库驱动的 Web 设计的最便捷方法,在面对挑战时保持自己的地位来自更难学习的集成框架(例如 Ruby on Rails)。”

我想我的问题是我假设 PHP 和 javascript 是访问数据库的唯一方法,并且一直认为 Ruby on Rails 是一个内容管理系统或类似的东西......所以我想我在问......什么在制作数据库驱动的网页时,Ruby on Rails 或其他我不熟悉的方法有什么优势?

I just got Learning PHP, javascript and MySQL by Robin Nixon and the first sentence in the states that:

"The Combination of PHP and MySQL is the most convenient approach to dynamic, database-driven wev design, holding its own in the face of challenges from integrated frameworks-such as Ruby on Rails-that are harder to learn."

I guess my question is that I assumed that PHP and javascript were the only ways to access the database, and always thought Ruby on Rails was a content managment system or something like that...So i guess I'm asking... What the advantages of Ruby on Rails or other methods I'm not familiar with when making databse-driven web pages?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

懵少女 2024-10-17 03:36:00

PHP是一种语言,Rails是Ruby上的一个框架。几乎任何语言都能够连接到数据源,无论是 mySQL、sql、sqlite 等。比较 PHP 和 Rails 是不公平的。您需要比较 PHP 和 Ruby,或者比较 CodeIgniter、CakePHP 等(PHP 框架)与 Rails。

Rails 有一个内置的 ORM(对象关系映射器),它可以通过将查询放入对象中来帮助优化并使查询变得更容易。它允许您设置关系数据库并提高数据的正常性。

坦率地说,这个问题太宽泛了。这是一个偏好、技能水平、时间和最终目标的问题。

PHP is a language, Rails is a framework ON Ruby. Almost any language has the ability to connect to a datasource, whether its mySQL, sql, sqlite, etc. It's not fair to compare PHP and Rails. You need to compare PHP and Ruby OR compare CodeIgniter, CakePHP, etc (PHP frameworks) to Rails.

Rails has a built-in ORM (Object relational mapper), which helps to optimize and make queries easier by putting them into objects. It allows you to set up relational databases and increase normalcy with your data.

Frankly, this question is entirely too broad. It's a matter of preference, skill level, time, and ultimate goal.

南风几经秋 2024-10-17 03:36:00

尝试两者都学习。

选择一个非常小的项目类型 - 例如,留言簿。在 PHP 中实现该项目,然后在 Rails 中实现相同的项目(或者相反)。

Try learning both.

Pick a very small type of project - for example, a guestbook. Implement the project in PHP and then implement the same project in Rails (or do it the other way around).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文