[OpenSIPS-Users] How to fetch more than one row from a query

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Jun 23 13:43:05 CEST 2009


Hi Eli,

The AVP$avp(s:callfwd) will contain multiple values (all the values 
returned by the query). The values are kept as a stack (last loaded 
value is first to be read). After using the top value, you can simply 
delete it (avp_delete() ) and the next val will be available.

Or you can use indexes:   $(avp(s:callfwd)[0]) - index 0 is the first value.

Regards,
Bogdan

Eli Hayun wrote:
> I have the following query :
> avp_db_load("$ruri/username","$avp(s:callfwd)")
>
> that returns more than one row. My questions are:
> 1) How to get the number of rows
> 2) How to fetch them one by one
>
> I tried to use : $avp(s:callfwd[1]) but with no success
>
> Thanks
> Eli
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   




More information about the Users mailing list