I have created 2 tables in php myadmin the first table is member with rows user_id - primary key name username password
the second table is blogdata with rows id - primary key author_id -foreign key references user_id in member table Title Content Category
here is my php to select from the database
<?php
session_start();
$_SESSION['author_id']='user_id';
$sql = mysql_query("SELECT * FROM blogdata where user_id = author_id");
while($row = mysql_fetch_array($sql)){
$title = $row['Title'];
$category =$row['Category'];
$content =$row['Content'];
$date =$row['date'];
?>
it keeps given me an error saying Warning: mysql_fetch_array() expects parameter 1 to be resource. any help would be greatly appreciated as i am new at php.
i have my database connection in so is not that.