<?php
$con=mysqli_connect("localhost","my_user","","shazz");
$query = mysqli_query($con,"SELECT * from posts2 order by rand() LIMIT 0,4");
$post_title ="shazz";
while ($row=mysqli_fetch_array($query))
{
$post_id=$row['post_id'];
$post_title=$row['post_title'];
$post_date=$row['post_date'];
$post_author=$row['post_author'];
$post_image=$row['post_image'];
$post_keywords=$row['post_keywords'];
$post_content=substr($row['post_content'],0,200);
}
?>
the following are the errors im facing:
Warning: mysqli_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'shazz' inC:\xampp\htdocs\shazz\include\main_content.php on line 3 Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given inC:\xampp\htdocs\shazz\include\main_content.php on line 4 Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given inC:\xampp\htdocs\shazz\include\main_content.php on line 6