If/Else clause with Else not pointing to DB

I’m brand new to working with php & mysql and my guru can’t answer this question so I thought I’d try here. :>)

I can’t figure out how to get a pic to load from the site instead of pulling it from the db (see line 6 below).

I’ve tried:

       <?php
       if (strlen($row_rsDirectoryHead['breedPic']) > 1)
       {
       echo $row_rsDirectoryHead['breedPic'];
       } else {
       <img src="DirectoryPics/dirNoPic.jpg" width="225" height="200" />;
   }
       ?>

but line 6 (<img src…) shows a syntax error. If I put a text string there (echo “some words”) it works. I’ve tried putting " " around line 6 and/or including the echo command but neither works. What would the correct syntax be for that line? I don’t want to have to go in and put the pic into every one of the 160+ breed records so any help will be appreciated. TIA! :>)


echo '<img src="DirectoryPics/dirNoPic.jpg" width="225" height="200" />';

Guess you need a new guru if he couldn’t figure that out <.<

THANK YOU logic_earth!! I did try it the way you did it here BUT I forgot the bloody semi-colon!! As for the guru, I’m finding out that you’re right, so you folks here may be hearing from me more often. ;>) Thanks so much.