$check1 = mysql_query("SELECT seller_id FROM seller s,user u WHERE u.id = s.seller_id and u.username ='".$username."'")or die("error");
louie wrote: is the error from the query made to the database or after? try this: [php] <?php include("db.php"); $check1 = mysql_query("SELECT seller_id FROM seller s,user u WHERE u.id = s.seller_id and u.username ='$username'")or die("error"); if ($info1 = mysql_fetch_array( $check1)){ echo "<a href=\"sell.php\">Sell a Book</a>"; }else{ echo "<a href=\"register_seller.php\">Become a seller</a>"; } ?> [/php]