Page 1 of 1

More if problems

Posted: Tue May 19, 2009 12:56 pm
by randall
I am having a problem with this code, it is not echoing null when there is not no db entry.

Code: Select all

 
 
<?php
if ($art=Unknown) { 
echo " "; 
}
else { 
echo "Artist: ";
} 
?>
</b></font>
 
<?php
if ($art=Unknown) { 
echo " "; 
}
else { 
echo "$artist";
} 
 
?>
 
<?php 
if (!$art) { 
echo " "; 
}
else { 
echo "$artist"; 
}
?>
 
<?php 
if (!$art) { 
echo " "; 
}
else { 
echo "<br>"; 
}
?>
 
 
<!--End artist -->
 
 

Re: More if problems

Posted: Tue May 19, 2009 1:04 pm
by John Cartwright
Post all the relevant code.

What is "Unknown"? Is it a constant or is it support to be a string? Lastly, you need to understand the difference between assignment operators and comparison operators.