$server = "localhost";
$userid = "your username";
$pass = "you password";
$database = "bpa";
$con = mysql_connect("$server","$userid","$pass")
or die ("Connection Error to Server");
$db = mysql_select_db("$database",$con)
or die("Connection Error to Database");
$sql="SELECT A FROM main WHERE A = 'B'";
$query = mysql_query($sql, $con);
while ($result=mysql_fetch_array($query)){
$field_a = $result["A"];
echo "$field_a<br>";
}
This doesn't seem very logical though becuase your result will always be B. Do you want to find other fields in the records that have an B value in field A?