Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class JConfig {
- public $dbtype = 'mysqli';
- public $host = 'localhost';
- public $user = 'xxxx';
- public $password = 'xxxx';
- public $db = 'xxxx';
- public $dbprefix = 'xxxx_';
- }
- <?php
- include("configuration.php");
- // Create connection
- $conn = mysqli_connect($host, $user, $password, $db);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "SELECT id, navn, email FROM XXXX";
- $result = mysqli_query($conn, $sql);
- if (mysqli_num_rows($result) > 0) {
- // output data of each row
- while($row = mysqli_fetch_assoc($result)) {
- echo "id: " . $row["id"]. " - Name: " . $row["navn"]. " " . $row["email"]. "<br>";
- }
- } else {
- echo "0 results";
- }
- mysqli_close($conn);
- ?>
- public $dbtype = 'mysqli';
- public $host = 'localhost';
- public $user = 'xxxx';
- public $password = 'xxxx';
- public $db = 'xxxx';
- public $dbprefix = 'xxxx_';
Add Comment
Please, Sign In to add comment