Skip to content

Using mysqli_connect in every file #1

Description

@lakshyabatman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions