0

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?

3
  • Out of interest, how does Nixon back up that assertion? Commented Jan 2, 2011 at 1:44
  • He doesn't in that passage. I just started looking at the book. Commented Jan 2, 2011 at 2:08
  • I suppose a book about PHP and MySQL isn't going to say anything else... Commented Jan 2, 2011 at 20:27

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Perhaps a fairer question would be, "what advantage does using a framework like CodeIgniter provide over using 'vanilla' PHP with its out-of-box capabilities?"
@Rob - agreed. I really dislike these kinds of questions though. If you as a programmer don't know which language to use for a particular task, then you shouldn't be using it...
0

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.