PHP Classes

Constructive Suggestions

Recommend this page to a friend!

      My PDO  >  All threads  >  Constructive Suggestions  >  (Un) Subscribe thread alerts  
Subject:Constructive Suggestions
Summary:These are only suggestions and meant to be constructive
Messages:2
Author:Dave Smith
Date:2015-05-13 05:38:15
 

  1. Constructive Suggestions   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2015-05-13 05:38:15
1) Since the operation of the class does not depend on the path, it would be better to just supply the class without hiding it deep in a directory structure.

Keep in mind that the end users (not us testing it) of your class will be people that don't know how to write it...

2) You should probably give an example file which shows how to instantiate the class and some basic operations.

3) In the dbconnect method, you are using constants for the database verification. Your end user may not have any clue what a constant is or how to use php to define them. All they ever will see when they run your class is connection failed message. Consider passing these values to the method, there really is no reason for them to be in the global scope since your class is never going to use them again in the current session.

Dave

  2. Re: Constructive Suggestions   Reply   Report abuse  
Picture of Mohamed Kamel Mohamed Kamel - 2015-05-13 06:39:27 - In reply to message 1 from Dave Smith
Thanks for the feedback
I will Edit it.