[asterisk-users] MySQL cmd % pattern matching

Bruce Komito brucek at bagel.com
Mon Dec 4 07:26:27 MST 2006


Try prefixing the "%" with a "\".

Bruce Komito
High Sierra Networks, Inc.
www.servers-r-us.com
(775) 236-5815


On Mon, 4 Dec 2006, Garth van Sittert wrote:

> Hi Jon
>
> No luck - it works with the quotes and no % sign but as soon as I add
> the % it doesn't work.
>
> Garth
>
>
>
> Jon Farmer wrote:
> > Try enclosing in single quotes. ie.
> >  SELECT name from contacts where tel like '%${number}'
> >
> >
> >
> > Jon Farmer
> > Telford, Shropshire, UK
> >
> > ----- Original Message ----
> > From: Garth van Sittert <garth at bitco.co.za>
> > To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
> > 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
> > 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 ${connid} ${query})
> >
> > But there seems to be a problem with the % sign and I don't know how to
> > hash it out.
> > It works without the % sign.
> >
> > Thanks
> >
> > Kind Regards
> > Garth
> >
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> >
> >
> >
> >
> >
> >
> >
> > ___________________________________________________________
> > All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
> > http://uk.docs.yahoo.com/nowyoucan.html
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
> This message has been categorized as "Indeterminate" by Bayesian Analyzer.
> Please click on this link if this message is a Spam
> http://nospam.wpti.net/bt/a.aspx?M=C:%5Csmtpmail%5CBayesTraining%5C2006-12-04%5Ceae2367087584a4396c6e4900352c414&C=2
>
> Or on this link if this message is a legitimate mail
> http://nospam.wpti.net/bt/a.aspx?M=C:%5Csmtpmail%5CBayesTraining%5C2006-12-04%5Ceae2367087584a4396c6e4900352c414&C=1
>
>
> --
> -----------------------------------------------------------------------
> This message has been inspected by DynaComm i:mail
> -----------------------------------------------------------------------
>
>



More information about the asterisk-users mailing list