![]() |
Please review my MySQL Class.
Hello!
My PHP isn't fantastic and usually I get others to program the main classes for me. However I decided to try and make a class myself in PHP5 - some help was given over at a different community because I forgot to define some variables. Anyway, my class: Code:
<?php |
Hi Sam,
Looking good so far :-) A couple of suggestions though, since you're using public/private keywords for the functions it wouldn't hurt to use them for the variables as well. PHP Code:
PHP Code:
PHP Code:
Other than that, looks good :-) Alan |
Looks great but you wasted your time, mysqli
|
Self-education is never a waste of time :-)
Also, rather than use a specific extension like mysqli, you'd be better of using PDO. Alan |
I agree with Alan, but for an alternate reason as well. My latest server move has put me on a server without BOTH PDO and mysqli. Never bind yourself to modules that may not be there when you can write your own easily enough.
|
Wouldn't it be better to call the Variables: Properties, and the Functions: Methods, considering that's what they are called in encapsulation? :P
|
| All times are GMT. The time now is 11:05 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0