文章分类:行业应用
syntax :
MYSQL(Connect connid dhhost dbuser dbpass dbname)
Connects to a database. Arguments contain standard MySQL parameters passed to function mysql_real_connect. Connection identifer returned in ${connid}. If the connection wasn’t possible, then ${connid} == “”.
MYSQL(Query resultid ${connid} query-string)
Executes standard MySQL query contained in query-string using established connection identified by ${connid}. Result of query is stored in ${resultid}.
MYSQL(Fetch fetchid ${resultid} var1/ var2/ …/ varN)
If any rows are available to select, ${fetchid} is set to 1 and a single row is fetched from a result set contained in ${resultid}. The return fields are assigned to ${var1}, ${var2} … ${varN} respectively. If no rows are left to select, ${fetchid} is set to 0 and ${var1}, ${var2} … ${varN} remain unchanged.
MYSQL(Clear ${resultid})
Frees memory and data structures associated with result set.
MYSQL(Disconnect ${connid})
Disconnects from named connection to MySQL.
Example
[mysqlcal] exten => 555,1,Answer exten => 555,n,MYSQL(Connect connid localhost bipin bipin voice_alerts) exten => 555,n,NoOp(${cnum}) exten => 555,n,NoOp(${jid}) exten => 555,n,MYSQL(Query resultid ${connid} INSERT INTO `callerinfo` (`number`) VALUES (‘${CALLERID(num)}’)) exten => 555,n,MYSQL(Query resultid ${connid} UPDATE `callerinfo` SET `status` = /’ANSWERED/’ WHERE `job`=${jid} AND `number`=${cnum})
转自:http://hwzyyx.javaeye.com/blog/576741
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/100512.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...