Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


benanamen last won the day on December 2

benanamen had the most liked content!

1 Follower

Contact Methods

  • Website URL
  • Yahoo

Profile Information

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

Recent Profile Visitors

7,781 profile views

benanamen's Achievements

Prolific Member

Prolific Member (5/5)




Community Answers

  1. Just an FYI, Tables for layout went out in the 90's, We use CSS now.
  2. @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', '');
  3. 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
  4. 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.
  5. 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
  6. 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.
  7. "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
  8. Two things. You need to upgrade your PHP to a current version. Second thing, mysql_* has been completely removed from PHP. I would suggest you use PDO with Prepared Statements. https://phpdelusions.net/pdo
  9. I am not suggesting you go to a Framework although they are structured the way I mentioned. Check out this free Laracast video series on PHP. It is the only video tutorial I have seen that I would recommend to anyone. It will get you going in the right direction. Watch each one even if you understand it already. The PHP Practitioner https://laracasts.com/series/php-for-beginners
  10. The "real" problem is that you have no Architecture to your site. Having a direct correlation of URLS to file paths is a very restrictive and low level design. By designing using a "Front Controller" or "MVC" pattern with a single point of entry you could move files anywhere you want without affecting the URLS. Optimally, all your files should be above the root save for the index.php and your assets such as images, JS and CSS. It may be above your current skill level but it is well worth learning.
  11. After re-reading this thread it seems apparent that what you really need is a BI (Business Intelligence) tool that is purpose built for the real problem you are trying to solve, generating various reports. Tableau and Power BI are such tools. (There are many others). I am going to bow out of your specific request since I think you are going about it wrong and are not willing to do anything beyond "how" you are trying to solve a problem.
  12. Since you are insisting on doing things they way you are, here is working code. <?php $host = ''; $db = 'test'; $user = 'root'; $pass = ''; $charset = 'utf8mb4'; $dsn = "mysql:host=$host;dbname=$db;charset=$charset"; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]; try { $pdo = new PDO($dsn, $user, $pass, $options); } catch (\PDOException $e) { throw new \PDOException($e->getMessage(), (int)$e->getCode()); } $sql = 'DROP PROCEDURE IF EXISTS test1'; $pdo->exec($sql); $sql ='CREATE PROCEDURE test1(IN LastID INT(5)) BEGIN SELECT person.RecordID AS PersonID, organization.Name FROM person INNER JOIN organization ON person.lnk_organization = organization.RecordID LIMIT 10; SELECT person.RecordID AS PersonID, organization.Name, organization.City, organization.State, organization.Zip FROM person INNER JOIN organization ON person.lnk_organization = organization.RecordID LIMIT 25; END'; $pdo->exec($sql);
  13. You will get a lot farther if you give us a high level overview of what you have going on rather than how you want to do it. "The users can create tables" is a very bad smell. Something is not right. What we currently have here is know as an XY Problem. https://xyproblem.info/
  14. It's hardly purist. It is basic Database Normalization. What are you going to do if there are more image caps, keep adding columns? +2 to the ADDITIONAL bad DB design. How is the OP supposed to learn when a forum expert shows them the wrong way.
  15. Surprised at you @Barand. There should be a separate table for the image caps keyed to the image url id not consecutive numbered columns. I know you know that.
  • 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.