Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DatabaseFunctions {
- public $host = "localhost";
- public $user = "root";
- public $pass = "";
- public $db = "cms";
- public $mysqli;
- public function pull_latest_post() {
- $this->$mysqli = new mysqli($this->host,$this->user,$this->pass,$this->db);
- $sql_latest = mysqli_query($this->mysqli,"SELECT * FROM content") or die("Failed to retrive latest posts!" . mysql_error($this->mysqli));
- while($result_latest = mysqli_fetch_array) {
- echo $result_latest['title'];
- echo "<br />";
- echo $result_latest['body'];
- echo "<br />";
- echo $result_latest['date'];
- }
- // End of while loop for pull_latest_post
- }
- // End of pull_latest_post
- }
- // End of class
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement