Count results of sc_lookup

This should be simple and it works in php 7.4, but bombs in 8.0

sc_lookup(fn,“select filenames from tablename where inezra =0”);

$arrct=count({fn});

CRASH: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given…

Am I being dense here?

Wouldn’t be better this way:

sc_lookup(fn,“select count(filenames) from tablename where inezra =0”);

$arrct={fn[0][0]};

?

Still will produce the same result if I’m selecting the whole row or just filename since each row has a filename. It still should give me the count of the results. Either way I am clueless why it sees {fn} as a boolean and not an array! I ended up doing pretty much what you suggested and getting a count {fn[0][0]} and then going from there so I have 2 sc_lookups instead of one but oh well.