ODBC writesql

what i trying to do is :
Calling > Enter Your Mobile Num and then Press * : 09132367096*
it would save to databases with Curent Date

My Database: mobile
My Table: user_mobile

mysql> select * from user_mobile;
±—±--------------------±------------+
| id | date | mobile |
±—±--------------------±------------+
| 1 | 2014-02-14 16:46:52 | 09132367096 |
| 2 | 2014-02-14 16:47:25 | 09132357777 |
| 3 | 2014-02-14 16:48:12 | 09132357777 |
| 4 | 2014-02-14 16:48:12 | 09132357777 |
| 5 | 2014-02-15 08:44:53 | 09132007777 |
| 6 | 2014-02-15 08:45:25 | 09133347777 |
| 7 | 2014-02-15 09:28:18 | 09133347777 |
| 8 | 2014-02-15 09:28:29 | 09133347777 |
| 9 | 2014-02-15 09:28:29 | 09133347777 |
±—±--------------------±------------+
9 rows in set (0.00 sec)

in mysql i insert Data with this code:
insert into user_mobile (date,mobile) values (now(),“09132367096”);

func_odbc.conf:
[MOBILE]
dsn=asterisk
writesql=insert into user_mobile (date,mobile) values (now(),${mobile})

Dialplan:
[office]
exten => 600,1,Playback(mark-student-id)
exten => 600,n,read(mobile)
exten => 600,n,NoOp(${ODBC_MOBILE()})
exten => 600,n,Hangup()

Error:

Connected to Asterisk 11.7.0 currently running on srv18903 (pid = 1220)
== Using SIP RTP CoS mark 5
– Executing [600@office:1] Playback(“SIP/payampersa-00000004”, “mark-student-id”) in new stack

0x7f81d8007340 – Probation passed - setting RTP source address to 3*.****:8000
– <SIP/payampersa-00000004> Playing ‘mark-student-id.slin’ (language ‘en’)
– Executing [600@office:2] Read(“SIP/payampersa-00000004”, “mobile”) in new stack
– User entered ‘09132367096’
[Feb 15 09:34:05] WARNING[1590][C-0000001d]: func_odbc.c:191 generic_execute: SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 Driver][mysqld-5.1.71]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 (185)
[Feb 15 09:34:05] WARNING[1590][C-0000001d]: func_odbc.c:199 generic_execute: SQL Exec Direct failed (-1)![select mobile from user_mobile22 where id = ]
[Feb 15 09:34:05] WARNING[1590][C-0000001d]: res_odbc.c:608 ast_odbc_direct_execute: SQL Execute error! Verifying connection to asterisk [asterisk-connector]…
[Feb 15 09:34:05] WARNING[1590][C-0000001d]: func_odbc.c:191 generic_execute: SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 Driver][mysqld-5.1.71]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 (185)
[Feb 15 09:34:05] WARNING[1590][C-0000001d]: func_odbc.c:199 generic_execute: SQL Exec Direct failed (-1)![select mobile from user_mobile22 where id = ]
[Feb 15 09:34:05] ERROR[1590][C-0000001d]: func_odbc.c:538 acf_odbc_read: Unable to execute query [select mobile from user_mobile22 where id = ]
– Executing [600@office:3] NoOp(“SIP/payampersa-00000004”, “”) in new stack
– Executing [600@office:4] Hangup(“SIP/payampersa-00000004”, “”) in new stack
== Spawn extension (office, 600, 4) exited non-zero on ‘SIP/payampersa-00000004’

what is wrong with this code?!

Hi,

i would try:

and in the dialplan

BTW it seems that you have proble also with readsql function

[Feb 15 09:34:05] WARNING[1590][C-0000001d]: func_odbc.c:199 generic_execute: SQL Exec Direct failed (-1)![select mobile from user_mobile22 where id = ]
empty id ??
IMHO it should be
select mobile from user_mobile22 where id = ‘some_stuff

Have ever tried the old and deprecated app_mysql module?
In one shot use is far more simple to use…

Here i explain how did i use that
http://www.pcbackup.it/func_odbc-phpagi-and-asterisk-migration/