-
Notifications
You must be signed in to change notification settings - Fork 340
php answers
Yegor Bugayenko edited this page Oct 1, 2015
·
2 revisions
This a list of problems in the PHP file, in order of importance (the biggest problems are on top):
- method
init()
must be replaced with a constructor - SQL injection is not mitigated
- code duplication in
getTitle()
andgetContent()
must be removed -
getMyDocuments()
is iterating through the entire list of docs, it's ineffective -
SELECT *
is a bad practice - variable names must start with underscore, like
$_user
- items in arrays start from zero, that's why
$row[3]
won't fetch the third cell -
Database::getInstance()
is a hard-coded dependency
If you miss all these problems listed at the top, we won't work with you.