[sr-dev] [tracker] Task opened: SQLOPS returns 0 for empty result set instead of $null

Juha Heinanen jh at tutpro.com
Fri Dec 6 10:17:33 CET 2013


sip-router writes:

> I use SQLOPS module to query additional data in MySQL database. Script logic is based on user related DB records existence. I check wether records exist or not simply by assigning variable:
> 
>         $var(touser) = $dbr(touser=>[0,0]);
>         if ($var(touser) != $null) {
>                 [...]
>         } else {
>                 [...]
>         }

perhaps better way to check if any records were returned is to test if
$dbr(result=>rows) is greater than 0.

-- juha



More information about the sr-dev mailing list