Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2012
    Location
    United Kingdom
    Posts
    39
    Thanks
    3
    Thanked 1 Time in 1 Post

    MySQLi Extended Class

    Currently building a MySQLi Extended Class in PHP.

    GitHub
    https://github.com/Clawed/MySQLiExtended

    Features
    - Prepared Statements
    -- Insert - Complete
    -- Select - Not started, trying to work how to do it.
    -- Update - Complete
    -- Delete - Complete

    Feedback
    - This would be appreciated.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    My feedback would be don't bother!

    I used to think these functions / classes were a great idea but then when you start using joins and other complex queries you simly won't be able to write a function simple enough to handle it all.

    Same for deletes that use joined tables. You can have all the parameters in the world in your function call but then whats the point trying to remember all those parameters (slowing you down) when you could just write the SQL instead? - look at what I mean:

    function select($table, $Columns, $Where, $Excludes, $Order, $Limit);

    Thats just for a simple select. Now why would I want to waste 30-40 seconds of my life remembering what those parameters are, creating arrays for the $Where and $Excludes parameters when I could just write the SQL far quicker?

    The only thing I will say is that using classes is ideal for multiple DB support. EG if your code / product is going to support MSSQL, Mysql and others then it's ideal as you can just switch between classes, call functions with the same name / parameter list and be done with it. If you're only supporting one database though it just isn't worth the hassle IMO.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  

    Posting Permissions

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