Created
January 20, 2026 14:15
-
-
Save maxixo/2d77e3780af9e291e1c515a28a420efd to your computer and use it in GitHub Desktop.
connecting mysql to php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $host = 'localhost'; | |
| $user = 'root'; | |
| $password = ""; | |
| $dbname = "myapp"; | |
| //create connection | |
| $conn = new mysqli($host,$user,$password,$dbname); | |
| //check connection | |
| if ($conn->connect_error) { | |
| die('connection failed : ' . $conn->connect_error); | |
| } | |
| echo "connected successfully"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment