Error connecting to database table

When I run a SQL query on the id & name from my “author” table in my database, the result generates a list of names. But in my php code, i receive the error message that it is unable to fetch the authors from the database. I know the authors are there so why can’t this code retrieve the names? The code is typed below.


// Display author list
include $_SERVER['DOCUMENT_ROOT'] . '/includes/';
$result = mysqli_query($link, 'SELECT id, name FROM author');
if (!$result)
	$error = 'Error fetching authors from database!';
	include 'error.html.php';

while ($row = mysqli_fetch_array($result))
	$authors[] = array('id' => $row['id'], 'name' => $row['name']);

include 'authors.html.php'; 

Keep an eye on this thread: as they have the same problem.

This problem seems to be rather common.

In addition to the above linked thread, Please try Searching using the vBulletin Advanced Search and SitePoint’s [URL=“”]Advanced Search

It is also being discussed here

To minimize confusion and make it easier for others to help, please do not start more than one thread dealing with the same topic.