PHP Database Object with INI Parsing

Видео-курсы ITVDN

Используй промо-код 48GBDDF и получи скидку 25% на все курсы
 
5,034
IMPORTANT: In the example I forgot to autoload() or include the objects in index.php :-) So do that if you do type this out! This is a quick tutorial on writing a Reusable Database Object, which extends a Database Properties Class, Which reads an INI file. In the real world you'd probably want to .htaccess protect the directory your INI files are listed. Also, this isn't a robust nor impressive Class, it's to give you a starting block to create your own DB object. You don't need to have a separate DatabaseProperties Object, but I think it's a good idea because your actual Database Class may eventually handle different databases or something, who knows really, I suppose it's a preference. Thanks to my friend David M. who's taught me a lot, even though he would critique this entire video to the death and tell me to redo it a much better way after lecturing me for a few hours LOL, then I'd have to learn something entirely new - As long as he doesn't see this video there won't be any problems, HAHA. NOTE: I had to edit a few parts to get it under 10 minutes so if it skips a little no worries :P
>

You have no rights to post comments