Hello and welcome to our community! Is this your first visit?
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
    United Kingdom
    Thanked 1 Time in 1 Post

    MySQLi Extended Class

    Currently building a MySQLi Extended Class in PHP.


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

    - This would be appreciated.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Your Monitor
    Thanked 523 Times in 510 Posts
    Blog Entries
    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.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


    Posting Permissions

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