Results 1 to 2 of 2

Thread: PHP OOP way in inserting data from form to database?

  1. #1
    Join Date
    Feb 2011
    Posts
    24

    PHP OOP way in inserting data from form to database?

    hello i am practicing OOP and i am very sad to see that i have not found any resources that can help me how to insert data to the database coming from an HTML form. I know how to do it in a structured manner. but now i am trying to figure it out in an OOP and industry standards way. can any one give me a sample. or direct me to a proper way. I lost man. thanks and more power.

  2. #2
    Join Date
    Feb 2007
    Location
    Ireland
    Posts
    1,007
    "Database" is such a broad term. I assume you are referring to a relational database system*. In that case, you will need to "map" the domain model to and from the relational model. There are various documented architectural patterns to accomplish this.

    A few notable ones are:

    1. Active Record Pattern
    2. Table Data Gateway Pattern
    3. Object-Relational Mapping


    That should get you started. Have at look through those and feel free to ask more specific questions.

    *Other database systems require different approaches.
    “The best thing about a boolean is even if you are wrong, you are only off by a bit.”

Similar Threads

  1. Replies: 0
    Last Post: 14 Apr 2009, 12:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •