[Asterisk-Users] using the MYSQL command to insert a record

Adam Goryachev mailinglists at websitemanagers.com.au
Thu Feb 3 00:15:28 MST 2005


On Wed, 2005-02-02 at 21:02 -0800, Robert Howard wrote:
> I am trying to use the MYSQL command to insert a
> record into a database and I can't seem to get it to
> work. I can do an UPDATE with no problem.
> Here is the line in my dialplan
> exten => s,12,MYSQL(QUERY resultid ${connid} INSERT
> INTO `member` ( `id` , `member_num` , `active` )VALUES
> ('',${number}' , '1'))

Try
exten => s,12,MYSQL(QUERY resultid ${connid} INSERT
INTO member \( id \, member_num \, active \)VALUES
\(''\,'${number}' \, 1\))

Some of those \'s might not be needed, or you might need to also escape the ' as well.

Of course, maybe you can't do an insert from a query .... you may need 
to look at the source code for more informaiton.

Regards,
Adam

-- 
 -- 
Adam Goryachev
Website Managers
Ph:  +61 2 8304 0000                        adam at websitemanagers.com.au
Fax: +61 2 9345 4396                        www.websitemanagers.com.au




More information about the asterisk-users mailing list