Hi All
Does anyone know how to use the MySQL cmd in Asterisk with LIKE and % in
the query?
I have:
exten => s,5,Set(query=SELECT name from contacts where tel like
%${number})
exten => s,6,MySQL(Connect connid hostname username password dbname)
exten => s,7,MySQL(Query resultid ${co
ecember, 2006 12:38:07 PM
Subject: [asterisk-users] MySQL cmd % pattern matching
Hi All
Does anyone know how to use the MySQL cmd in Asterisk with LIKE and % in
the query?
I have:
exten => s,5,Set(query=SELECT name from contacts where tel like
%${number})
exten => s,6,MySQL(C
Garth van Sittert wrote:
exten => s,5,Set(query=SELECT name from contacts where tel like
%${number})
exten => s,6,MySQL(Connect connid hostname username password dbname)
exten => s,7,MySQL(Query resultid ${connid} ${query})
This is how I would do it:
exten => s,5,MYSQL(Query resultid
ssage
From: Garth van Sittert <[EMAIL PROTECTED]>
To: Asterisk Users Mailing List - Non-Commercial Discussion
Sent: Monday, 4 December, 2006 12:38:07 PM
Subject: [asterisk-users] MySQL cmd % pattern matching
Hi All
Does anyone know how to use the MySQL cmd in Asterisk with LIKE and % in
I have it working as your example, Doug, but unfortunately I need the
like phrase as the numbers all contain spaces or sometimes even brackets.
Garth
Doug Lytle wrote:
Garth van Sittert wrote:
exten => s,5,Set(query=SELECT name from contacts where tel like
%${number})
exten => s,6,MySQ
Ah, I found the solution to my problem:
I slashed out the ' to give:
exten => s,5,Set(query=SELECT name from contacts where tel like
\'%${number}\')
exten => s,6,MySQL(Connect connid hostname username password dbname)
exten => s,7,MySQL(Query resultid ${connid} ${query})
Kind Regards
ginal Message
> > From: Garth van Sittert <[EMAIL PROTECTED]>
> > To: Asterisk Users Mailing List - Non-Commercial Discussion
> >
> > Sent: Monday, 4 December, 2006 12:38:07 PM
> > Subject: [asterisk-users] MySQL cmd % pattern matching
> >
> > Hi