Can I please help a little to fix my little beginner project?

This is my first post of something like this. I am full n00b when programming / php. I tried to understand all the tutorials there and wanted to create some kind of framework for basic projects for web db / applications. I came up with several files for crud operations, which, as I know, should really be awful code. I was wondering if I could get advice on moving this “framework” to the next level. I'm not very good at OO, but I understand the concepts, so instead I have become more functional. I know that the songs are rude, I do not need help recognizing this.

I need help with database calls. I understand that I have to use PDO (to help with the injection), but I'm not sure how to convert this code to this structure. I also understand that at least I have to use mysqli functions. Again, n00b.

I am also aware of data verification and disinfection, but again, being so new to this, I don’t know where to start. Especially if I want to keep it strong and small. Comments are ridiculous from the point of view of programmers, but hey, you work with what you have. I am trying to understand MVC and be able to bind AJAX and templates / shells, but the essence of this is to work with databases.

I like how there is one configuration file that works with all other files, and how this leads to small files for index, read and delete. The rest get a little longer. Not that including files makes me cool or anything else.

I think that I fail to understand MVC and structure the project in order to maintain it and adapt it more easily. I also understand that in these php files there are a lot of html files, which is also a no-no. How to fill in the blanks of what I know (I know every line of every file) so that I know.

The code can be found here (maybe not a sourceforge worthy, but I want to help others find out how I am).
https://sourceforge.net/projects/eleete/files/

+3
source share
4

, , CMS , Wordpress, , , - , , , , , , , , .

, - , - . , db , , , , , .. db, , siteinfo() , , . , , functions.php, , .

, - , , - , , , . , .

+3

, ! , , , . .

, . , , , , .

, , . - , . , craps, , . , , , - .

. , .

, , , ! , , , , , , . Qaru , . !

+1

, . , CodeIgniter . MVC, , , , , , . Zend, , , , .

MVC OO - , , . . MVC, , ..

PDO , sql Mysql_escape_string . PDO - , .

, Xdebug . .

+1

, - , , .

API . , , , , . , , - , , , . , . , SQL UPDATE , ? , , .

Another key quality that arises at the moment is refactoring. The phrase "be ready to throw the first aside" is sometimes referred to in programming circles. In fact, this means that you should always be open to the idea of ​​rewriting the code, because you thought about how best to do it. Even if you need to rebuild the code that calls it.

+1
source

Source: https://habr.com/ru/post/1771587/


All Articles