Last active
August 29, 2015 14:11
-
-
Save ryanseys/99a7b81a25fa5cfeceb9 to your computer and use it in GitHub Desktop.
database.php
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 | |
$db = new mysqli("localhost", "root", "password", "courses"); | |
$sql = "INSERT INTO prerequisites VALUES('elec2501', 'phys1004', 'math1005', '')"; | |
$db->query($sql); | |
echo "done"; | |
$sql2 = "SELECT * FROM prerequisites"; | |
$rows = $db->query($sql2); | |
while($row = $rows->fetch_object()) { | |
echo "<li>".$row->title."</li>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment