API - PHP

Hello guys , i have this command → /interface wireless access-list print count-only where interface=wlan2 … and this work fine in command line.
but i try do this in API with lib php.

$API->write(‘/interface/wireles/access-list/print’,false);
$API->write(‘=count-only=’,false);
$API->write(‘=where=’,false);
$API->write(‘=interface=wlan2’);

returning this error → array(1) { [“!trap”]=> array(1) { [0]=> array(1) { [“message”]=> string(17) “unknown parameter” } } }

anyone can help ? Sorry about my english.

What you are trying to do is not possible. Use queries instead
https://wiki.mikrotik.com/wiki/Manual:API#Queries

Thanks ,

$API->write(‘/interface/wireles/access-list/print’,false);
$API->write(‘=count-only=’,false);
$API->write(‘=where=’,false);
$API->write(“?interface=$wlan”);

Now , works so fine.