Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: text/html; charset=ISO-8859-1'); //no changes
- $servername = "localhost";
- $username = "root";
- $password = "password";
- $dbname = "db_test4";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- mysqli_set_charset("utf8");
- echo "From PHP Script ååååån"; //to see if there is problem when edit the script
- $sql = "SELECT * FROM test_tbl";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo "Kundid: " . $row["kund_id"]. " - Förnamn: " . $row["fnamn"]. " - Efternamn: " . $row["enamn"]. " - Adress:" . $row["adress1"] ."<br>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement