Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am done with HTML and CSS. Now I want to know whether I should study PHP and SQL together or individually. Basically, I have this book, O'Reily Head First PHP and MySQL. Should I take this book or start with a book for PHP only? And is there any difference?

share|improve this question

migrated from stackoverflow.com May 31 '11 at 5:46

6 Answers

up vote 8 down vote accepted

I'd say study it together. The majority of PHP applications you'll ever build are likely to involve some kind of database interaction, and MySQL is most popular seen in light of PHP.

You might not become familiar with all the 'inner workings' of MySQL, but you'll learn what you need to know to get going. Furthermore, i don't think you should look at MySQL as a topic which will 'steal' your attention from PHP. A large proportion of working with MySQL databases in PHP is all about learning how to communication with the databases (using PHP) and will become good exercises themselves.

share|improve this answer
I concur wholeheartedly – MattyD May 31 '11 at 5:48
@MattyD so i shall go on with the same book?? – Kraken May 31 '11 at 5:52
Indeed, that's true! – Adam Arold May 31 '11 at 7:32
I've read a couple of Head First books, and they tend to explain things in a sound way. Go with the book you have, and look things up on the Internet if there's something you do not understand. – sbrattla Jun 1 '11 at 6:40

As most programmers aren't DBAs, I'd suggest studying PHP in depth and learning the basics of MySQL as you encounter them. Having said that, I'd also strongly suggest that once you're confident with the PHP that you've learned, that you do spend time learning some of the more advanced MySQL topics.

IMHO, it's better to split the two up this way as both subjects are quite deep.

Edit: This would also most likely be better asked on programmers.SE.

share|improve this answer

if you want to learn from basic think in php then start only php first see the syntax and clear the concept of the php and it's easy also. you can start to read both simultaneously.

share|improve this answer

Together I say. What ever book or tutorial you're following will almost often teach you how to interact with a database after a few chapters. However, I do suggest that you spend some (not much) time learning MySQL basics before you jump on to PHP. You can then take timeout from learning PHP to catch up with advanced MySQL.

share|improve this answer

It really depends on your programming background. If all you have worked with is html and css then you'll find that working with php will be quite different and will take much time to master. However, if you do have other programming experience (i.e. c/c++, java, etc), then you likely will have no problem at all studying them together. That being said either way you may be fine to study them together as sql really isn't that difficult to pick up the basics, and is more than a little handy to use in web applications. Ultimately you'll have to decide how you feel you're handling it as you start learning either or both. Another option might be to study the basics of SQL first (shouldn't take you very long to do this) then start in on studying both of them together.

share|improve this answer

I'd say separate.

I've seen too many confused beginners unable to clearly distinguish the SQL part from the PHP part, concatenating values into queries and happily mixing SQL queries, PHP code, HTML, and javascript, and then wondering why they can't execute javascript in their SQL queries, or why they can't do SQL queries in a javascript function or something.

Grasping HTTP, PHP and HTML is confusing enough as it is.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.