As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Good books for learning PHP (and a bit of MySQL)

GrimReaperGrimReaper Registered User regular
Ok, so I've had an idea for doing something and I'm thinking of going at it with PHP+MySQL. However, my PHP and MySQL are a bit rudimentary (not done anything with PHP in a couple of years, so forgotten lots). I'm decent with ASP/VBScript and SQL server.. however these days for MS website based dev it's more focused towards ASP.NET and I'm only okay with C#.

So, I figured PHP+MySQL. In the past i've been quite happy with books from O'Reilly and Wrox, however to say there are a lot of PHP+MySQL books around is an understatement.

Recommend me some good books, stat!

PSN | Steam
---
I've got a spare copy of Portal, if anyone wants it message me.
GrimReaper on

Posts

  • Options
    NightslyrNightslyr Registered User regular
    edited September 2009
    GrimReaper wrote: »
    Ok, so I've had an idea for doing something and I'm thinking of going at it with PHP+MySQL. However, my PHP and MySQL are a bit rudimentary (not done anything with PHP in a couple of years, so forgotten lots). I'm decent with ASP/VBScript and SQL server.. however these days for MS website based dev it's more focused towards ASP.NET and I'm only okay with C#.

    So, I figured PHP+MySQL. In the past i've been quite happy with books from O'Reilly and Wrox, however to say there are a lot of PHP+MySQL books around is an understatement.

    Recommend me some good books, stat!

    For the absolute beginner, I recommend: http://www.amazon.com/PHP-MySQL-Dynamic-Web-Sites/dp/032152599X/ref=sr_1_1?ie=UTF8&s=books&qid=1252185402&sr=8-1

    PHP 6 isn't out yet, and 5.3 was just released a little bit ago, so don't write code that uses namespaces or late static binding.

    If you're serious about doing it the right way, you'll need: http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_1?ie=UTF8&s=books&qid=1252185515&sr=1-1

    Stay far, far away from any resources that focus on/use PHP 4. That version is old, shitty, and no longer supported by Zend.

    Nightslyr on
  • Options
    GrimReaperGrimReaper Registered User regular
    edited September 2009
    Nightslyr wrote: »
    GrimReaper wrote: »
    Ok, so I've had an idea for doing something and I'm thinking of going at it with PHP+MySQL. However, my PHP and MySQL are a bit rudimentary (not done anything with PHP in a couple of years, so forgotten lots). I'm decent with ASP/VBScript and SQL server.. however these days for MS website based dev it's more focused towards ASP.NET and I'm only okay with C#.

    So, I figured PHP+MySQL. In the past i've been quite happy with books from O'Reilly and Wrox, however to say there are a lot of PHP+MySQL books around is an understatement.

    Recommend me some good books, stat!

    For the absolute beginner, I recommend: http://www.amazon.com/PHP-MySQL-Dynamic-Web-Sites/dp/032152599X/ref=sr_1_1?ie=UTF8&s=books&qid=1252185402&sr=8-1

    PHP 6 isn't out yet, and 5.3 was just released a little bit ago, so don't write code that uses namespaces or late static binding.

    If you're serious about doing it the right way, you'll need: http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_1?ie=UTF8&s=books&qid=1252185515&sr=1-1

    Stay far, far away from any resources that focus on/use PHP 4. That version is old, shitty, and no longer supported by Zend.

    Thanks, i've been playing with a few other things too. I just had a mess around in PostgreSQL and it's well.. a bit weird. Getting it to say create an auto-incrementing primary key field is just plain freaky. It has to be done in a strangely roundabout way. Think I'll stick to MySQL.

    GrimReaper on
    PSN | Steam
    ---
    I've got a spare copy of Portal, if anyone wants it message me.
  • Options
    TroopaTroopa Registered User regular
    edited September 2009
    I second Nightslyr's recommendations.

    There is also a lot of great material online, like:

    PHP 101

    Practical PHP Programming (a complete book, for free!)

    and a new site I'm working on, PHP Programming Tutorials. :winky:

    Troopa on
  • Options
    theSquidtheSquid Sydney, AustraliaRegistered User regular
    edited September 2009
    GrimReaper wrote: »
    Nightslyr wrote: »
    GrimReaper wrote: »
    Ok, so I've had an idea for doing something and I'm thinking of going at it with PHP+MySQL. However, my PHP and MySQL are a bit rudimentary (not done anything with PHP in a couple of years, so forgotten lots). I'm decent with ASP/VBScript and SQL server.. however these days for MS website based dev it's more focused towards ASP.NET and I'm only okay with C#.

    So, I figured PHP+MySQL. In the past i've been quite happy with books from O'Reilly and Wrox, however to say there are a lot of PHP+MySQL books around is an understatement.

    Recommend me some good books, stat!

    For the absolute beginner, I recommend: http://www.amazon.com/PHP-MySQL-Dynamic-Web-Sites/dp/032152599X/ref=sr_1_1?ie=UTF8&s=books&qid=1252185402&sr=8-1

    PHP 6 isn't out yet, and 5.3 was just released a little bit ago, so don't write code that uses namespaces or late static binding.

    If you're serious about doing it the right way, you'll need: http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_1?ie=UTF8&s=books&qid=1252185515&sr=1-1

    Stay far, far away from any resources that focus on/use PHP 4. That version is old, shitty, and no longer supported by Zend.

    Thanks, i've been playing with a few other things too. I just had a mess around in PostgreSQL and it's well.. a bit weird. Getting it to say create an auto-incrementing primary key field is just plain freaky. It has to be done in a strangely roundabout way. Think I'll stick to MySQL.

    MySQL screws up a few things in the desire to be simple and friendly. It barely qualifies as a RDMS. PostgreSQL is frankly better, but that aside, regarding PHP I'll say what I always say regarding programming books:

    Always buy the book written by the author of the language itself.

    In this case, it's Programming PHP.

    theSquid on
  • Options
    NightslyrNightslyr Registered User regular
    edited September 2009
    theSquid wrote: »
    Always buy the book written by the author of the language itself.

    In this case, it's Programming PHP.

    Bad, theSquid, bad! That book is written based on PHP 4 syntax. Not to mention that Lerdorf is no longer the author of the language.

    Protip: if the OOP section of a PHP book uses the keyword 'var' in the section that describes declaring data members, it's PHP 4, and thus shitty.

    Nightslyr on
  • Options
    theSquidtheSquid Sydney, AustraliaRegistered User regular
    edited September 2009
    Right, I didn't know.

    :(

    theSquid on
  • Options
    SenshiSenshi BALLING OUT OF CONTROL WavefrontRegistered User regular
    edited September 2009
    W3Schools was shown to me by a friend when I started using PHP/MySQL--it's a fairly good beginner's resource for rudimentary stuff. I'm gonna assume that you're quite an intelligent guy and therefore can get a fair deal of mileage from what the site teaches along with the official PHP site.

    If you look at it the way I do, digital is better 'cause you can Search it.

    <3

    Edit: I've no idea if this is PHP 4 or not, and I shouldn't say "who cares, it works" because I'm an absolute dick when it comes to CSS and HTML validating properly, but--who cares, it works. (please don't hurt me)

    Senshi on
  • Options
    NightslyrNightslyr Registered User regular
    edited September 2009
    Senshi wrote: »
    W3Schools was shown to me by a friend when I started using PHP/MySQL--it's a fairly good beginner's resource for rudimentary stuff. I'm gonna assume that you're quite an intelligent guy and therefore can get a fair deal of mileage from what the site teaches along with the official PHP site.

    If you look at it the way I do, digital is better 'cause you can Search it.

    <3

    Edit: I've no idea if this is PHP 4 or not, and I shouldn't say "who cares, it works" because I'm an absolute dick when it comes to CSS and HTML validating properly, but--who cares, it works. (please don't hurt me)

    Well, if someone/the OP is just doing it for shits and giggles, then yeah, it doesn't really matter if they're using PHP 5 or not, because chances are they're not going to dive into the OOP stuff. The procedural portion of the language has remained largely unchanged for a decade or so.

    But, if they're going to be doing anything more than that, then PHP 5 is definitely the way to go. It's not a stretch to call 4's treatment of OOP an abortion.

    Nightslyr on
  • Options
    GrimReaperGrimReaper Registered User regular
    edited September 2009
    So, I just noticed an oddity..

    If I do:

    $bob = NULL;
    echo is_null($bob);

    It returns 1 to the page.

    If however, I do:

    $bob = "Blah";
    echo is_null($bob);

    It returns nothing to the page, shouldn't it be printing out 0?

    I'm pretty sure if I did the equivalent under ASP VBScript it'll pump out true or false.

    Yeah, i'm right.. If I do:

    bob = "test"
    response.write(isnull(bob))

    It returns false and it returns true if I assign null to bob, this is quite bizarre.

    GrimReaper on
    PSN | Steam
    ---
    I've got a spare copy of Portal, if anyone wants it message me.
  • Options
    NightslyrNightslyr Registered User regular
    edited September 2009
    GrimReaper wrote: »
    So, I just noticed an oddity..

    If I do:

    $bob = NULL;
    echo is_null($bob);

    It returns 1 to the page.

    If however, I do:

    $bob = "Blah";
    echo is_null($bob);

    It returns nothing to the page, shouldn't it be printing out 0?

    I'm pretty sure if I did the equivalent under ASP VBScript it'll pump out true or false.

    Yeah, i'm right.. If I do:

    bob = "test"
    response.write(isnull(bob))

    It returns false and it returns true if I assign null to bob, this is quite bizarre.

    Welcome to PHP, where nothing works quite the way it should.

    Nightslyr on
  • Options
    GrimReaperGrimReaper Registered User regular
    edited September 2009
    Nightslyr wrote: »
    GrimReaper wrote: »
    So, I just noticed an oddity..

    If I do:

    $bob = NULL;
    echo is_null($bob);

    It returns 1 to the page.

    If however, I do:

    $bob = "Blah";
    echo is_null($bob);

    It returns nothing to the page, shouldn't it be printing out 0?

    I'm pretty sure if I did the equivalent under ASP VBScript it'll pump out true or false.

    Yeah, i'm right.. If I do:

    bob = "test"
    response.write(isnull(bob))

    It returns false and it returns true if I assign null to bob, this is quite bizarre.

    Welcome to PHP, where nothing works quite the way it should.

    That's intended behaviour? It's not meant to output anything if is_null is false?

    That's just silly. I was thinking maybe it was a bug in the windows build of php.

    If it's of any interest i'm currently messing with PHP (5.3.0) in a windows xp vm, i've got a centos vm but i've not yet bothered playing with php in it yet.

    GrimReaper on
    PSN | Steam
    ---
    I've got a spare copy of Portal, if anyone wants it message me.
  • Options
    NightslyrNightslyr Registered User regular
    edited September 2009
    GrimReaper wrote: »
    Nightslyr wrote: »
    GrimReaper wrote: »
    So, I just noticed an oddity..

    If I do:

    $bob = NULL;
    echo is_null($bob);

    It returns 1 to the page.

    If however, I do:

    $bob = "Blah";
    echo is_null($bob);

    It returns nothing to the page, shouldn't it be printing out 0?

    I'm pretty sure if I did the equivalent under ASP VBScript it'll pump out true or false.

    Yeah, i'm right.. If I do:

    bob = "test"
    response.write(isnull(bob))

    It returns false and it returns true if I assign null to bob, this is quite bizarre.

    Welcome to PHP, where nothing works quite the way it should.

    That's intended behaviour? It's not meant to output anything if is_null is false?

    That's just silly. I was thinking maybe it was a bug in the windows build of php.

    If it's of any interest i'm currently messing with PHP (5.3.0) in a windows xp vm, i've got a centos vm but i've not yet bothered playing with php in it yet.

    I'm not sure if it's intended behavior, but it's the current behavior nonetheless.

    Nightslyr on
  • Options
    GrimReaperGrimReaper Registered User regular
    edited September 2009
    Nightslyr wrote: »
    GrimReaper wrote: »
    Nightslyr wrote: »
    GrimReaper wrote: »
    So, I just noticed an oddity..

    If I do:

    $bob = NULL;
    echo is_null($bob);

    It returns 1 to the page.

    If however, I do:

    $bob = "Blah";
    echo is_null($bob);

    It returns nothing to the page, shouldn't it be printing out 0?

    I'm pretty sure if I did the equivalent under ASP VBScript it'll pump out true or false.

    Yeah, i'm right.. If I do:

    bob = "test"
    response.write(isnull(bob))

    It returns false and it returns true if I assign null to bob, this is quite bizarre.

    Welcome to PHP, where nothing works quite the way it should.

    That's intended behaviour? It's not meant to output anything if is_null is false?

    That's just silly. I was thinking maybe it was a bug in the windows build of php.

    If it's of any interest i'm currently messing with PHP (5.3.0) in a windows xp vm, i've got a centos vm but i've not yet bothered playing with php in it yet.

    I'm not sure if it's intended behavior, but it's the current behavior nonetheless.

    Hmm, but if I use:

    $bob = "blah";
    If (!(is_null($bob))) echo "It's not null fella";

    It'll print out "It's not null fella", so it seems maybe the functionality to print out directly whether something is false using is_null is broken?

    Very odd.

    GrimReaper on
    PSN | Steam
    ---
    I've got a spare copy of Portal, if anyone wants it message me.
  • Options
    Recoil42Recoil42 Registered User regular
    edited September 2009
    Again: Welcome to PHP.

    Recoil42 on
  • Options
    GrimReaperGrimReaper Registered User regular
    edited September 2009
    Recoil42 wrote: »
    Again: Welcome to PHP.

    Are there any other known gotchas?

    GrimReaper on
    PSN | Steam
    ---
    I've got a spare copy of Portal, if anyone wants it message me.
Sign In or Register to comment.