Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // Database credentials may differ on your machine
- $servername = "localhost";
- $username = "root";
- $password = "root";
- $dbname = "appdev";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- // Use a mysql query to select data from the database
- $result = mysql_query("SELECT * FROM `locations`;");
- while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
- echo $row[0], $row[1], $row[3];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement