Hi, i am using asterisk v1.4.18.
and asterisk addon 1.4.8
Here is my dialplan :
exten => s,1,MYSQL(Connect connid ${host} ${user} ${pass} ${db})
exten => s,2,MYSQL(Query resultid ${connid} CALL InsertUser("${id}"\,"${user_id}"\,"${code}"\,"${num}"\,"${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}")
exten => s,n,MYSQL(Disconnect ${connid})
The InsertUser procedure is ok, but the asterisk shows this error :
app_addon_sql_mysql.c:270 aMYSQL_query: aMYSQL_query: mysql_query failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
exten => s,2,MYSQL(Query resultid ${connid} CALL InsertUser(“${id}”,“${user_id}”,“${code}”,“${num}”,“${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)}”)
Try this:
exten => s,2,MYSQL(Query resultid ${connid} CALL InsertUser(${id}\,${user_id}\,${code}\,${num}\,${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)})
if that doesn’t work, try using slashes to escape the quotes.
Mark_Logan:
[quote]exten => s,2,MYSQL(Query resultid ${connid} CALL InsertUser(“${id}”,“${user_id}”,“${code}”,“${num}”,“${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)}”)
Try this:
exten => s,2,MYSQL(Query resultid ${connid} CALL InsertUser(${id}\,${user_id}\,${code}\,${num}\,${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)})
if that doesn’t work, try using slashes to escape the quotes.[/quote]
Hic, Do you have any code that work find, show me how to use.