2018 create news wbsite using php

Here's a basic outline to create a news website using PHP in 2018:

Step 1: Plan Your Website

Step 2: Set Up Your Development Environment

Step 3: Design Your Database

Step 4: Create Your PHP Scripts

Step 5: Create Your HTML Templates

Step 6: Connect to Your Database and Display News Articles

Step 7: Add User Registration and Login

Step 8: Add Commenting and Categorization

Step 9: Style Your Website

Step 10: Test and Deploy Your Website

Here's some sample PHP code to get you started:

<?php
// news.php
require_once 'database.php';

// Connect to the database
$conn = mysqli_connect($host, $username, $password, $database);

// Check connection
if (!$conn) {
    die("Connection failed: ". mysqli_connect_error());
}

// Query the database to retrieve a list of news articles
$query = "SELECT * FROM articles";
$result = mysqli_query($conn, $query);

// Display the news articles
while ($row = mysqli_fetch_assoc($result)) {
    echo "<h2>". $row['title']. "</h2>";
    echo "<p>". $row['content']. "</p>";
    echo "<p><a href='article.php?id=". $row['id']. "'>Read more</a></p>";
}

// Close the database connection
mysqli_close($conn);
?>

This is just a basic example to get you started. You'll need to add more functionality and features to create a fully functional news website.