Created
October 21, 2013 06:27
-
-
Save abdullahbutt/7079459 to your computer and use it in GitHub Desktop.
PHP mysqli_query() Function
This file contains 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 | |
$con=mysqli_connect("localhost","my_user","my_password","my_db"); | |
// Check connection | |
if (mysqli_connect_errno($con)) | |
{ | |
echo "Failed to connect to MySQL: " . mysqli_connect_error(); | |
} | |
// Perform queries | |
mysqli_query($con,"SELECT * FROM Persons"); | |
mysqli_query($con,"INSERT INTO Persons (FirstName,LastName,Age) | |
VALUES ('Glenn','Quagmire',33)"); | |
mysqli_close($con); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment