Re: MySQL Book and PHP vs Perl
by Your Mother (Archbishop) on Oct 08, 2009 at 17:44 UTC
|
Paul DuBois's books on the subject are widely considered excellent. I've even seen them called the best entry-level technical books on any tech topic. He discusses both Perl and PHP at length.
Side stepping that. I like MySQL. I use MySQL and have for years. I would recommend if you're starting from scratch that you go with PostgreSQL instead. I would also recommend Perl over PHP but PHP is awfully convenient and well supported on budget hosts. If you just want to get going and do a little hacking: PHP. If you think you have a future in this stuff and plan to take it deeper: Perl (it's a superior jumping off place for *many* technical issues and even other languages). Also, it's easy, and natural at first, to write insecure code with databases in any language. Make sure to search for tutorials on security and SQL injection attacks.
Have fun.
| [reply] |
|
|
Well said, and thank you! Well if you wouldn't mind answering another question... what book to get started in Postgress can you recommend over the others?
Also, would you care to elaborate on why PosgreSQL over MySQL? The benefits I've heard for MySQL are small, fast, easy. What are the benefits of PosgreSQL?
Thanks!
| [reply] |
|
|
For Postgres reading material, I'd suggest the Postgres docs themselves: They are through, and easy to find stuff in. (At least for me. I find the MySQL docs horrible.)
Add to that some general database books if you have never worked with databases before. Sorry, I don't have any recommendations for those.
As for benefits: It scales better to large datasets, it has a fuller selection of database features, and it operates very close to the official spec for SQL. (Where MySQL deviates fairly widely from it on occasion. Which can be nice on occasion, but it means you'd be learning bad habits in those cases.)
If you just want to learn, and are really care about 'small, fast, easy', SQLite might also be worth a look. There isn't a smaller database out there, it's still very fast, and it's definitely the easiest to set up. But it has a very different audience. (Although it follows the SQL spec better than MySQL, and has some features MySQL is missing...)
I've also found either of the above much easier to use and install with Perl than MySQL, but that seems to be a fairly local thing. (Although the DBD::Mysql docs have huge 'if it doesn't work' sections...)
| [reply] |
|
|
:) That reminds me of the story about the drunk crawling around one night under the street lamp. Passer-by asks, "What are you doing?"
Drunk replies, "Looking for my car keys."
"Oh, you lost them here?"
"No. But this is the only place with enough light to look for them."
Based on books (and maybe even documentation) alone, MySQL could be a better choice. I don't know any Postgres books to recommend. Someone will probably come to your rescue here though. There are quite a few monks who prefer the engine. The good news is, there's not really a wrong choice. You'll find plenty o'discussions here on the topic.
| [reply] |
Re: MySQL Book and PHP vs Perl
by halfcountplus (Hermit) on Oct 08, 2009 at 18:38 UTC
|
I've been using HTML::Mason to do embedded web work a la PHP for a while now and it rocks -- you might want to check that out.
I've even written a tutorial, which will at least provide a simple picture, and there are links to more info (eg, the first edition of an O'Reilly book is now free on-line):
Intro to Embedded Perl Using Mason
The example demo in the tutorial is a small on-line site that uses an SQL database.
Amazon uses perl instead of php.
The only potential drawback is you need a server running apache mod_perl. But here's an example advantage: I have a web based chat that uses a separate, stand-alone server for some processing. The server is written in perl, so it and the embedded web page stuff can share the same module for functions like verification, etc. etc.
Then you can forget php and dedicate your mind to perl :) | [reply] |
Re: MySQL Book and PHP vs Perl
by Joost (Canon) on Oct 08, 2009 at 21:02 UTC
|
Perl vs PHP: Last I checked, DBI was just a better "low level" database interface than anything PHP has to offer, but that might have changed in the last 2 - 3 years. But most of the differences are in the ease of using safe and efficient constructs and unicode support (which is pretty good in DBD::mysql)
In any case, learning DBI or whatever PHP database interface is fairly trivial once you've got your SQL/MySQL skills up to scratch. The interfacing language isn't really that important, as far as database programming is concerned.
| [reply] |
Re: MySQL Book and PHP vs Perl
by planetscape (Chancellor) on Oct 08, 2009 at 20:59 UTC
|
| [reply] |
Re: MySQL Book and PHP vs Perl
by mickep76 (Beadle) on Oct 09, 2009 at 11:16 UTC
|
Well books is a thing of the past generation, Google has all you need.
Best approach to learn is usually start a small project like make a web app. with a database backend. Then use Google to find good tutorials and then simply copy/paste until you have something that is similar to what you want. Usually you pick the basics very fast using this principle and it will also save you the cost of that book, you never read anyway.
Regarding Perl vs. PHP it's a personal preference. I would recommend starting with Perl since once you get a hang of Perl, PHP will seem like a walk in the park.
| [reply] |