Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by benanamen

  1. Seems to me this is the real problem. Stop them from signing both and you wont have to fix it afterwards.
  2. Is this code representative of what you have been taught in school? If so, your teacher needs schooling.
  3. Why not just get it from the DB the way you want it instead of jumping through code? SELECT IF (did_ivr_disable = TRUE, 'Enabled', 'Disabled') AS did_ivr_disable
  4. That is not what you were shown to do. Look again.
  5. Does this look right? <?=$bbname?'.'> <?=$navtitle?'.'>
  6. You close out the form for the search but have no form opening for the rest. You are also missing the method attribute for the one you do have.
  7. Just a little tip on the trim function.... If you use a guard clause you can get rid of the else and clean up the function just a bit. Also, when you call the function, there is no need to call it with array_map. The $_POST data is already being run through array_map. No need to do it twice. 😀 <?php function _trim($val) { if (!is_array($val)) { return trim($val); } return array_map('_trim', $val); } $post = _trim($_POST);
  8. Why do you have two tables for the same data? Duplicated data is a red flag to a bad DB schema. Learn about Database Normalization.
  9. @ginerjm, inet_aton is a mysql/mariadb function and is for properly storing/retrieving IP addresses in the DB. https://mariadb.com/kb/en/inet_aton/ See also https://mariadb.com/kb/en/inet_ntoa/ https://mariadb.com/kb/en/inet6_aton/ https://mariadb.com/kb/en/inet6_ntoa/
  10. I would suggest you start with the most minimal code needed to create a DB connection and start from there.
  11. Your "downloader" doesn't do anything. Why not just link directly to the files? You create a database connection that serves no purpose whatsoever. Your $ip is a variable for nothing and does nothing.
  12. For starters.... The DB connection "should" be passed to the Class using Dependency Injection, not extending Dbh. The submit button does not need a name attribute You should use Guard Clauses and get rid of the elses's
  13. You have the $ sign bass ackwards. It comes first.
  14. If you are going with a Windows WAMP, Laragon is the best one out of all of them for many reasons. I have used them all. https://laragon.org/
  15. You would first need to trim the POST array as a space would bypass the check.
  16. Just an FYI, Tables for layout went out in the 90's, We use CSS now.
  17. @gizmola and I both gave you code that you have not implemented. You should spend some time going through this PDO tutorial. Making a PDO connection is one of the simplest things you would ever need to do. https://phpdelusions.net/pdo This is all that is required to make a PDO connection. Anything you do beyond this, you should know exactly WHY you are doing more. $con = new PDO("mysql:host=localhost;dbname=test", 'root', '');
  18. Why are you extending PDO? There is no reason for you to do that and you haven't "extended" anything. You already create a connection in Config.php. Why are you recreating it again in Data.php? Take a look at my "Clean PDO" example. https://github.com/benanamen/clean-pdo
  19. For a Windows Dev my recommendation is Laragon and PhpStorm IDE. For Production Server, Debian OS with a current LAMP stack. You will also want to use GIT.
  20. The best books I have found that deals with the Party Model A.K.A "Universal Data Model" is "The Data Model Resource Book" volumes 1-3 by Len Silverston. Your project is a perfect fit for this data model. You will end up needing to re-think how you are currently looking at your data. There are no tenents or vendors. There are parties that have one or more roles that could be a tenent, vendor or anything else. it is possible that a party has multiple roles such as being a tenent AND a vendor. Your current model could not handle that without duplicating data. The party model, no problem and no redesigning or duplicate data whatsoever. https://www.amazon.com/Data-Model-Resource-Book-Enterprises-ebook/dp/B006BBVQQY https://www.amazon.com/gp/product/B0033AHGMY/ref=dbs_a_def_rwt_bibl_vppi_i0 https://www.amazon.com/gp/product/B004U7MUOS/ref=dbs_a_def_rwt_bibl_vppi_i1
  21. IMO, your whole model is off. You would really benefit from implementing the "Party Model". Without getting too deep into it,... at the root you have a Party. A Party is either a Person or an Organization. It then branches off from there. The Party Model is infinitely scalable without having to ever re-design anything. * When you start duplicating things, i.e names, phone numbers, etc, that is a good sign you probably have a design problem. Here is an example.
  22. "Every resource" is wrong. Try reading the free manual. This is too simple to just give you the answer. https://www.php.net/manual/en/mysqli.quickstart.connections.php https://www.php.net/manual/en/mysqli.select-db.php
×
×
  • 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.