Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes
Accepted

A PHP class for the common database operations?

Yes of course it's OK to have such a file. However, your Connection class is hardly related to actual CRUD operations. It's more a DAO, a database abstraction object. Speaking of the code you provided,...
Your Common Sense's user avatar
4 votes
Accepted

Follow up to Validation Script in PHP

First query looks good. any more improvements I don't understand why you're even asking the question. What part of Sam's "use bound variables" answer was unclear? We start out with ...
J_H's user avatar
  • 27.7k
4 votes
Accepted

PHP Validation script

Use bound parameters in database queries In the answer to your previous question by Your Common Sense was this advice: in SQL, always use parameters instead of PHP variables for any database ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
3 votes
Accepted

SQL & PHP login method

Yes indeed, your approach is severely outdated. Such a code nowadays is frowned upon. Here are some rules for the better code Each script should consist of four parts Initialization. Usually it's ...
Your Common Sense's user avatar
2 votes

A PHP class for the common database operations?

Closing PHP tag can be omitted The file appears to only have PHP code (and nothing else like HTML). Per the PHP documentation for PHP Tags: If a file contains only PHP code, it is preferable to omit ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
1 vote
Accepted

PHP login codes suggestions

Nice to hear you got your code working. I will help you a bit with the validation script. These are the points of improvement: Your input filtering is not doing anything because you haven't specified ...
KIKO Software's user avatar
1 vote

PHP MySQLi Wrapper Class For API

There is quite a lot of issues and possible improvements. For example, the entire Config class being one big pile of useless cargo cult code that you wrote not because it is really needed but just to ...
Your Common Sense's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible