writing a class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shalini Bhalla
    New Member
    • Dec 2007
    • 190

    writing a class

    hi

    I want to create a class for db connection.
    I want to create such a class which

    1 ) can be connected to any database ,

    2)can execute basic add/delete/update etc queries on any table . Here as it can take any table fields can vary in no and type.

    can any one tell me how to write 2nd part.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Yes, create classes for each of your tables (value objects as they're called) represent the "model" in a MVC architecture.

    Your DB class I can give to you. But it needs explanation as it's my class and there no manual written for my framework.

    PM me if your interested.





    Dan

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      maybe the PEAR::MDB2 package is worth looking into

      regards

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by dlite922
        Yes, create classes for each of your tables (value objects as they're called) represent the "model" in a MVC architecture.

        Your DB class I can give to you. But it needs explanation as it's my class and there no manual written for my framework.

        PM me if your interested.





        Dan
        Stick it on phpclasses.org. Don't be selfish. ;]

        Comment

        • dheeraj857
          New Member
          • Feb 2008
          • 14

          #5
          you can also use PDO(Php data objects). inbuild library for connecting different databases.

          Dheeraj Sharma

          Comment

          Working...