If statement in binding for Database template

I’m trying to publish out the URL of an image associated with an item to a database. The binding works perfectly as:

$row.PRODUCT_IMAGE_LARGE = 'http://www.mysite.com' + $rx.location.generate($sys.assemblyItem,'crpBnImage1')

The issue is that some of the items do not have images and in that case I want to publish out a null or a blank space, or some flag besides the assembly path. Here is the if statement I’m using, and no matter what I try I get an error that is located at the ‘)’ ending the $rx.location…

if($sys.item.getProperty('rx:img1_filename')){'http://www.mysite.com' + $rx.location.generate($sys.assemblyItem,'crpBnImage1')}else{''}

The error I receive is:
Unexpected exception while assembling one or more items: Problem when evaluating expression “” for variable “$row.PRODUCT_IMAGE_LARGE”: Problem parsing expression: if($sys.item.getProperty(‘rx:img1_filename’)){‘http://www.mysite.com’ + $rx.location.generate($sys.assemblyItem,‘crpBnImage1’)}else{’’} at character 126

I tried replacing the location variable with a string (which would not be acceptable as it changes depending on site), but I continue to get an error related with the first section of the if statement. For example, if I use $sys.item.getProperty('rx:img1_filename.String, it complains about the ‘.’ before String.

Any help or ideas would be much appreciated.

-Cade

I solved the issue after enough trial and error. I was missing semicolons after each statement. Here is my final code which works as intended:

if($sys.item.getProperty('rx:img1_filename').String != ""){$imgpath + $rx.location.generate($sys.assemblyItem,'crpBnImage1')[B];[/B]}else{''[B];[/B]}