David Murphy
2008-Sep-25 22:17 UTC
[asterisk-users] Mysql Command and number rows returned
Without issuing a separate loop thru a result set. Is there any way anyone knows of to output the number of rows a mysql query returned. Aka .. exten => 1,n,MYSQL(Query resultid ${connid} SELECT\ `State`\ FROM\ `AreaCodes`\ WHERE\ `AreaCode`=\'${CIDArea}\') exten => 1,n(fetchrow),MYSQL(Fetch foundRow ${resultid} number) ; fetch row exten => 1,n,GotoIf($["${foundRow}" = "1"]?done) ; leave loop if no row found exten => 1,n,Set(State=${State}) exten => 1,n,Goto(fetchrow) ; continue loop if row found exten => 1,n,Set(RowsReturned=MYSQL(Fetch rowcount ${resultid}) exten => 1,n(done),MYSQL(Clear ${resultid}) .. David Murphy Systems Adminsitrator myLogo Email: AIM: <mailto:omar at icewatermedia.com> david at icewatermedia.com lgdavidmurphy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080925/ff5d6561/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 14498 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080925/ff5d6561/attachment-0001.jpeg