php
PHP Magic Constants
Magic Constants are mainly used for debugging OR logging purposes in PHP.
CONSTANTS in PHP
CONSTANTS must be defined and can’t be changed throughout the program like $variables can. CONSTANTS are global and therefore can be accessed from FUNCTIONS as well. Other facts about constants:
Connecting to MySQL DB with PHP
It’s very easy to connect to MySQL database using PHP. You just need to know HOSTNAME, USERNAME (this is DB username), PASSWORD (pw for DB), DB_NAME and that’s it. It’s better to have a separate PHP file named connect.php for connection information. There are TWO ways of doing this. EXAMPLE 1 is more cleaner and … Read more