I am playing around with this trying to pull some articles from a database.
Here is the code i have so far: ($host etc are defined in config)
include ("admin/config.php");
$mysqli = mysqli_connect($host, $user , $pass , $database);
$query = "SELECT * FROM articles ORDER BY date LIMIT 5";
$result = mysqli_query($mysqli,$query);
while($row = mysqli_fetch_array($result))
{
Some code to display results
}
This is the error that gets generated but i just cant see what i am doing wrong. Any help will be much appreciated.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /website....