> context testsql { > s => { > MYSQL(Connect connid ${DBHOST} ${DBUSER} ${DBPASS} ${DB}); > MYSQL(Query resultid ${connid} SELECT > TIMEDIFF(callend,callstart) FROM tblCall WHERE id=7); > MYSQL(fetch fetchid ${resultid} temp); > MYSQL(Disconnect ${connid}); > } > } > </CODE> > > The error I'm getting is below: > [Mar 6 08:59:35] WARNING[27116]: app_addon_sql_mysql.c:268 > 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 ') FROM tblCall WHERE id=7' at line 1
I think the solution would be to escape the , with a backslash, so your query would look like this: SELECT TIMEDIFF(callend\,callstart) FROM tblCall WHERE id=7 Maybe even the brackets ().... -- Andreas Sikkema _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users