Larry
Administrators-
Posts
5413 -
Joined
-
Last visited
-
Days Won
155
Everything posted by Larry
-
Chapter 12 - when to use '@'
Larry replied to tocilog's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
The @ is the error suppression operator. It's a blunt tool to stop errors from being displayed, but you'll generally only want to use it when the errors are still being handled in some way. -
If developing locally, what you really want to do is enable display_errors in your PHP configuration. If not developing locally, you'll want to do this too, but it may not be as easy! Otherwise, you'll need to find out where your web server records error messages (what log file) and then open that to see what the problem is.
-
You can swap !empty() for empty() if you're more comfortable with that logic, but you'd have to rework all the other logic, too. For example, your code checks if the password matches the confirmed password if the password is empty. It also sets $problem equal to true if the password is not empty. Both of these are backwards. If you want to use empty(), rework the following subsections, too.
-
12.6_view_entries.php
Larry replied to tri's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Apologies for the delayed reply; I was on vacation! Kudos for figuring it out, though, and thanks for posting your solution! -
Apologies for the delayed reply; I was on vacation! Thanks for your question and interest in the book. The fourth edition was a really heavy rewrite of the 3rd edition; the fifth edition is a fairly mild update: Fixed all the bugs; made everything up-to-date for the current standards, PHP 7, etc.; moved the appendix back into the printed edition, but lost Chapter 19 accordingly; added a bit more security. It covers the same OOP as the 4th and I'm pretty sure both cover PDO for MySQL. If you have the 4th edition, you may not benefit that much from the 5th (maybe look at "What's new in PHP 7" instead). Thanks again!
-
Hey! Thanks so much for the nice words and for your interest in the PHP Advanced book. I really appreciate it. I don't have a plan to update either the PHP Advanced book or the e-commerce book right now, which means no new edition would come out this year. Really appreciate the thought and support, though!
-
Downloads
Larry replied to Kehinde Lawal's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
No problem. Thanks for letting me know you figured it out! -
Thanks for the nice words and for the interest in the books! I really appreciate it. I'd do those books in the opposite order, though. The PHP & MySQL has some overlap with this one, but goes into much greater detail, in more depth, and uses different examples. You'll probably want a bit more practice in before reading the Advanced book. Thanks again!
-
Hmmm...so I don't have a great answer for you here. With foreign key constraints in place, it's supposed to be a PITA to wipe out tables. Your solution seems to be okay. The only other thing I thiiiiiiink works is: Delete * from table B Delete * from table A (now that the constraints aren't an issue) Truncate both I'm not positive that works all the time and it's not necessarily better.
-
Chapter 12
Larry replied to shanna's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Ah! Sorry for the confusion, you may have found a bug. I would have thought I would have caught this! The conditional on line 22 only confirms that the query ran okay. It actually needs to confirm that one row was returned instead. So sorry about that! I'll get it fixed.