Jump to content

Recommended Posts

I've never done any OOPHP and I'm trying to get my head wrapped around the concept.  I think I've got it but I have a question.  Isn't OOPHP like databasing without actually using a database?  This is my understanding of how it works...

 

OOPHP

class X{
     functionY(p1,p2,p3){
          property1
          property2
          property2
     }
}
do_functionY(p1,p2,p3);

 

PHP&DB

(input to DB here)
for(xxxxx){
    mysql_result(p1);
    mysql_result(p2);
    mysql_result(p3);
}
while(i>0){
    echo "p1,p2,p3";
}

 

I know the examples aren't syntactically correct but I was trying to be brief, and they get my point across.  I've read a bunch of tutorials and such for OOPHP but I don't understand the purpose when databasing does the same thing(at least in my mind  :)).  Any help would be much appreciated, I've been debating this for some time now...

Link to comment
https://forums.phpfreaks.com/topic/204854-oophp-vs-phpdb/
Share on other sites

Ok, so OOPHP and PHPDB need to be essentially put on the same level, as in they coexist instead of one relying on or replacing the other, correct?  My question arises from my current project, a car audio website.  I'm trying to figure out how to apply OOPHP to that car audio website.  Right off the bat, I know I can apply OO concepts to a shopping cart, and the car audio items, but I'm not sure how much further it can go(as I have limited knowledge of OO).

 

Hypothetical Q: Could you treat an entire website as an object?

 

e.g.

class website{

        var $my_website

        __construct(my_website){

        function header(){

        }

      function body(){

      }

Ok, so OOPHP and PHPDB need to be essentially put on the same level, as in they coexist instead of one relying on or replacing the other, correct?  My question arises from my current project, a car audio website.  I'm trying to figure out how to apply OOPHP to that car audio website.  Right off the bat, I know I can apply OO concepts to a shopping cart, and the car audio items, but I'm not sure how much further it can go(as I have limited knowledge of OO).

 

Hypothetical Q: Could you treat an entire website as an object?

 

e.g.

class website{

        var $my_website

        __construct(my_website){

        function header(){

        }

      function body(){

      }

Ok, so OOPHP and PHPDB need to be essentially put on the same level, as in they coexist instead of one relying on or replacing the other, correct?  My question arises from my current project, a car audio website.  I'm trying to figure out how to apply OOPHP to that car audio website.  Right off the bat, I know I can apply OO concepts to a shopping cart, and the car audio items, but I'm not sure how much further it can go(as I have limited knowledge of OO).

 

Hypothetical Q: Could you treat an entire website as an object?(or am I making this way too abstract? lol)

 

e.g.

class website{

        var $my_website

        __construct(my_website){

        function header(){

        }

      function body(){

      }

      function footer(){

      }

}

Link to comment
https://forums.phpfreaks.com/topic/204854-oophp-vs-phpdb/#findComment-1072433
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.