use mysql_num_rows();it will tell you if you have query results
$result = mysql_send("SELECT * FROM datatable WHERE id='".
$_SESSION['id']."'ORDER BY id ASC LIMIT 2");
$count = mysql_fetch_array($result);
if($count > 0) {
while($row=mysql_fetch_array($result)) {
}
}
if ($a == 1) {
echo 'No History';
} else {
echo '<a href="#">View history</a>';
};
if, assigment, comparison: $a = 1 $a = 1 $a == 1 1