Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] AEL - SQL and TIMEDIFF()


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
andreas.sikkema at bbe...
Guest





PostPosted: Thu Mar 06, 2008 7:48 am    Post subject: [asterisk-users] AEL - SQL and TIMEDIFF() Reply with quote

Quote:
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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services