Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5389
  • Joined

  • Last visited

  • Days Won

    154

Larry last won the day on May 18

Larry had the most liked content!

About Larry

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Larry's Achievements

Apprentice

Apprentice (3/14)

  • Dedicated Rare
  • First Post Rare
  • Collaborator Rare
  • Posting Machine Rare
  • Week One Done Rare

Recent Badges

435

Reputation

  1. Thanks for your interest and sorry for the delayed reply. Right now there's no plan to update the PHP Advanced book. I've not even spoken with the publisher about it. Thanks again, though, for asking!
  2. If you just google "xampp mail server windows" you'll find plenty of tutorials on the subject. (I don't have XAMPP on Windows, so I don't know off the top of my head.)
  3. From there error messages, you have two issues to resolve. The first is you haven't configured a local mail server. The second is your error handling script still references the $e_vars variable, which it no longer has defined as an argument.
  4. There are two issues here. One is that there's an error going on in the script. The second is the error handling isn't working properly. For the latter, you don't mention what version of PHP you're using, but I expect the warning in the box applies: https://www.php.net/manual/en/function.set-error-handler.php Remove the last parameter from the my_error_handler() definition, as well as the use of that $e_vars variable within it. Once you fix that, you should properly see the actual error that's happening on the page.
  5. Glad that's working for you and thanks for letting me know about the emails. I'll look into it. Cheers!
  6. My inclination is it's either not being stored or retrieved in a format that PHP can use. I'd check/confirm your column type. Also, it's best not to use "Date" as a column name since it's also a keyword in MySQL. That being said, I'd have MySQL return the data in the format you want, rather than ask PHP to convert it.
  7. Hey Max. Kudos for figuring it out and thanks for sharing the solution. The first thought that came to my mind would be to store the coordinates in separate columns. In other words, split the coordinates upon receipt and then store them in two columns. That'll make future work easier to do.
  8. Hey Nick, are you setting a "from" address when you send the email? Also, it may help if you use placeholder values when describing the problem here. I'm not 100% sure I understand the distinctions you're trying to make (e.g., sending the email to me vs receiving an email or all the uses of "me").
  9. So you have the script D:\xampp\htdocs\phpmysql4_scripts\ch09\view_users.php which is including ../mysqli_connect.php. The ../ bit means "go up one directory from the current directory". Up one directory from D:\xampp\htdocs\phpmysql4_scripts\ch09 is D:\xampp\htdocs\phpmysql4_scripts, so the code is looking to include D:\xampp\htdocs\phpmysql4_scripts\mysqli_connect.php.
  10. Hey Marie. From what you describe, if the problem isn't with the database then it's with your code. In other words, it could be giving you that error message for the wrong reason. Looking through the downloaded code, I don't think this book uses a "form functions" file but it does use a login functions file.
  11. Thanks so much for the kind words and for the interest in a Python book. I truly appreciate it. Unfortunately I'm not well versed in Python, so that's not in the cards. Thanks again, though!
  12. Yes, that would be my assumption: that it's doing a conversion. If it wasn't, then the SHA2() function would return an error for an improper argument.
  13. Thanks for your questions and for the nice words. For the first question, when executing queries like this, there really is no "automatic". In a real application these queries would be executed by code that verifies the results as part of the process. For example, using PHP you could start a transaction, fetch the balances, adjust the balances, fetch the new balances, verify, and then commit. For the second question, what you describe is called a "race condition" and can be prevented by implementing locks. So you'd lock the row, run one update, and then unlock the row. A subsequent query that would theoretically make a quantity negative (assuming that wasn't allowed) would then fail.
×
×
  • Create New...