Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


benanamen last won the day on May 26

benanamen had the most liked content!

Community Reputation

109 Excellent


About benanamen

  • Rank
    Master Coder

Contact Methods

  • Website URL
  • Yahoo

Profile Information

  • Gender
    Not Telling
  • Interests
    Email me at phpfreaks@galaxyinternet.us

Recent Profile Visitors

4,060 profile views
  1. Yeah, the question smells. OP tell us what the real problem is you are trying to solve instead of asking about your attempted solution to solving it.
  2. I would suggest you take some time to get down on SOLID principles. Here are a couple links. (I didn't read these pages. There may be better links) https://medium.com/prod-io/solid-principles-takeaways-ec0825a07247 https://www.hashbangcode.com/article/solid-principles-php
  3. There is much that could be said about this code, but to keep on point, you need to use Dependency Injection and pass an instance of the helper class to your user class just like you did with the PDO connection. * The duplicate query should be one of the first clues of a problem with this class. This pretty much explains what I see here so the current state of the code makes sense for now. You should eventually end up with quite a bit of refactoring when you get it dialed in.
  4. What have you tried besides posting this on every coding forum?
  5. The first problem is that you are using variables in your query. You need to use Prepared Statements. You have not shown us where $check1_res comes from.
  6. Your right. It "doesn't work".
  7. Truncate the table. It will also delete all the data. TRUNCATE TABLE table_name; TRUNCATE TABLE table_name;
  8. Allow me to direct you to the PHP Manual. It gives you an exact example of what you are asking. https://www.php.net/manual/en/function.error-log.php
  9. In HTML5, the "action" is not necessary at all when submitting to the same page. You can simple do like so... <form method="post">
  10. The one thing that hasn't been mentioned is WHY would YOU want to do this in the first place?
  11. The last part could use some cleanup. if (mysqli_num_rows($result)) { return $result; } return false;
  12. OP, What is the point of adding another layer (Javascript) just to get a random value? Why not just generate in Php? And rather than tell us about your attempted solution to the real problem, how about tell us what the real problem is.
  13. All of this... $category = $_POST['category']; $item_type = $_POST['item_type']; $item_size = $_POST['item_size']; $product_name = $_POST['product_name']; $item_qty = $_POST['item_qty']; $price = $_POST['price']; $total_price = $_POST['total_price']; $item_price = $_POST['item_price'];
  14. Get rid of the variables for nothing. You already have the POST values, just use them.
  • 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.