the following prints out just fine if there is an author and year in the database for the field "subgenero". The problem is if there is no author and year in the database the "," between the two fields still prints out even though the fields are empty. Is there a way to write this so that if the author and year fields are empty the "," won't print out either.
if($row_rsspecies['subgenero']) {
if($base_subgenero != $row_rsspecies['subgenero']) {
echo str_repeat("<dd>",$i++).'Subgen'. " " .$row_rsspecies['subgenero']." ".$row_rsspecies['author'].",".$row_rsspecies['year'];
$base_subgenero = $row_rsspecies['subgenero'];
} else {
$i++;
}
} else {
$base_subgenero = '';
}
Thanks