New answers tagged

3

Sam's answer covers a lot of good points I am not going to repeat, but I will tell you more issues. Private properties What is the point in setting constants as private properties? What is the purpose of having all these config values as private properties if they are only used in the constructor? These values should come from a config file that is stored ...


3

Canonical advice from a helpful post As was mentioned in a comment there is a post with helpful advice for classes like this: Your first database wrapper's childhood diseases (written by @YourCommonSense). It recommends setting the exception mode to PDO::ERRMODE_EXCEPTION which appears to be the case with the code here. It also recommends: Tell PHP to ...


1

There is one thing that is not right in your application: tabs and indentation. Example: if(isset($_POST['filter_button'])){ if(isset($_POST['ad_brand'])) $brand = $_POST['ad_brand']; else{$brand = '';} So the code is hard to read and decipher because it is too compact, indentation and spacing are not consistent and the control flows are not ...


Top 50 recent answers are included