Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DataBase {
- function request($item) {
- $servername = "XXXXXXXXXXX";
- $username = "XXXXXXXXXXXX";
- $password = "XXXXXXXXXXXXX";
- $dbname = "XXXXXXXXXXX";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT $item FROM francophonie
- ORDER BY RAND()
- LIMIT 1";
- $result = $conn->query($sql);
- return $result;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement