Suggestion: Using the same connection commands in every file, creates unmodularity in the project which isn't a good way of writing project.
Solution: Make a separate file for writing connection commands and then importing the file in other files using require or include command.
Reference: https://www.w3schools.com/php/php_includes.asp
And also it's a great option to keep hostname, username, and password in a separate variable in a separate file, naming config.php and importing it to connection file 💯 . It reduces security flaws. 👍
You can call me, I won't mind. :p
Suggestion: Using the same connection commands in every file, creates unmodularity in the project which isn't a good way of writing project.
Solution: Make a separate file for writing connection commands and then importing the file in other files using require or include command.
Reference: https://www.w3schools.com/php/php_includes.asp
And also it's a great option to keep hostname, username, and password in a separate variable in a separate file, naming config.php and importing it to connection file 💯 . It reduces security flaws. 👍
You can call me, I won't mind. :p