-
#5727 |
Could someone help me to know, how write a queries to select info in variables pin in visual Dial plan which is entered by caller “DTMF” and find it in database cc_user in MySQL where username= ” variables pin in visual dial-plan” and save the out put in to the new variables like PIN-FROM-MYSQL in visual dial plan.
#5728 |Aaboonasr,
Check this tutorial, it explains how to create and use SELECT statement http://www.w3schools.com/sql/sql_select.asp.
Also, read this tutorial
http://www.apstel.com/visual-dialplan-tutorials/database-connectivity/It explains how to use IS and how to create and execute sql queries. It also contains a simple example on how to use dial plan variables within SQL query.
You should be able to create the query after reading this tutorials.
Raman
-
This reply was modified 10 years, 2 months ago by
admin.
#5729 |Thanks it works. but I need to get other data from same table also and store it in other variables ,
Here is my current query , and this query will save only pin in mysql-pin variables in visual dial plan, how can I
run other query (#2) and store ping in mysql-pin and ID in ID variables in mysql Embedded IS.” I mean to add data from mysql to two different variables in VD.@@${pin}=5513563105
select username from cc_user where username=${pin}Query #2
@@${pin}=5513563105
select username,id from cc_user where username=${pin}thanks,
Amir
#5730 |Amir,
If I understand this correctly you don’t need two queries.
If you wish to obtain username and id from cc_user table, you just need #2 query.
Use this query “select username,id from cc_user where username=${pin}” and in “Edit DbQuery” window select “mysql-pin” and “ID” variables under the “Variables” section, this way “username” will be stored in “mysql-pin” and “id” in “ID” variable.Raman
-
This reply was modified 10 years, 2 months ago by
You must be logged in to reply to this topic.