Trying to do this:
https://forum.scriptcase.net/forum/developers/hot-tips/685-conditional-image-in-a-grid
The field ‘attachments’ is a text field. On record I am doing this:
// Check for record
$check_sql = “SELECT COUNT(*) FROM bbw_files WHERE parent_id = ‘{note_id}’” ;
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
$attached_file_count = {rs[0][0]};
}
else // No row found
{
$attached_file_count = ‘’ ;
}
{attachments} = $attached_file_count ;
if ($attached_file_count >= ‘1’) {
{attachments} = “<img src=’…/_lib/img/scriptcase__NM__ico__NM__paperclip_16.png’/>” ;
} else {
{attachments} = ‘’ ;
}
When I run the application, I get “Error - Array to String conversion”. I have also tried “Check for an existing record” and get the same thing.