Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by benanamen

  1. Just to clarify, my response had nothing to do with MVC. It was with the Database Class itself.
  2. Typically yes, that's what you see out on the net, but I would have to disagree with this method. IMO there is really only two common cases to use Try/Catch, that being the DB Connection and handling a duplicate constraint error. There is no need to litter the code base with Try/Catch blocks. (Yes, I was guilty of that until I got spanked by @Jacques1 and learned better) What "should" be done is set the PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION and let the exceptions bubble up and let PHP handle it, which it does very well. set_exception_handler can also be used if you want a custom handler for exceptions.
  3. Link please. Based on the DB class, the tutorial is less than optimal.
  4. In a single form? That sounds like quite a lot. What exactly do you have going on?
  5. That particular tutorial has issues.
  6. You need to implement PRG. (POST, REDIRECT, GET)
  7. You may also want to look into Temporal Data Tables or Audit Logging depending on your specific needs.
  8. The best way to do DB backups is not with PDO. What you want to do is write a shell script that acts directly on the DB and set up a CRON job to run it at whatever intervals.
  9. The first thing you need to do is stop mixing obsolete mysql_* code with mysqli.
  10. If you passed it in as a parameter you would never have to edit anything and could use the function for any currency
  11. I have been using MVP (Model - View - Presenter) for some time. Works quite well.
  12. By the way, your test_input function is a block of code from the 90's that needs to be taken behind the barn and shot and buried forever. Surprised to still see that floating around. Additionally, NEVER EVER put variables in your query. You need to use prepared statements
  13. What is this "bridge" you created? What do you mean "doesn't allow direct access to mysql Server"? What does Mysql have to do with where you are putting your Php code?
  14. Why are you using Cookies for the login instead of sessions? Do you know the differences?
  15. 1. If those are your real column names you need to change them to something meaningful. Nobody knows what BBB or YYY or CCC means. 2. You likely have a DB design problem that needs to be normalized. Tell us about this data and what it represents.
  16. Hi Unique Idea Man, AKA UIman, AKA visiter52, aka 2020. After THREE years of us trying to teach you about Mysqli and coding under your various alt's across numerous forums, are we really right back at at the very beginning as though you have never seen this stuff?
  17. $_SERVER['PHP_SELF'] is vulnerable to an XSS Attack. Just delete the action completely. Yes, it is, but it is a Security problem and shouldn't be used. You "could" use it if you enclosed it in htmlspecialchars but that is just sloppy. Cleaner to leave the action out completely.
  18. print "<p style='color:red;'>Could not delete the blog entry because :<br/>" .mysqli_error($dbc);
  19. You can use set_exception_handler to create a custom exemption function. https://www.php.net/manual/en/function.set-exception-handler.php
  20. <a href="tel:123-456-7890">123-456-7890</a>
  21. This page may be of help to you. We all started at the beginning. http://www.catb.org/~esr/faqs/smart-questions.html
  22. What is the real problem you are trying to solve by doing this? What is the high level overview of what you have going on?
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.