Created
June 7, 2014 19:42
-
-
Save temitope/1d5b566adb9de4334325 to your computer and use it in GitHub Desktop.
test mysqli libraries
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 | |
//grab the vars needed out of the form post body | |
//connect to mysql database (so we can run commands) | |
// Create connection | |
$con=mysqli_connect("127.0.0.1","root","","test"); | |
// Check connection | |
if (mysqli_connect_errno()) { | |
echo "Failed to connect to MySQL: " . mysqli_connect_error(); | |
} | |
$result = mysqli_query($con,"SELECT * FROM goals"); | |
while($row = mysqli_fetch_array($result)) { | |
echo $row['name'] . "-" . $row['id']; | |
echo "<br>"; | |
} | |
//insert a new goal into the mysql database | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment