thanks Mr. Muhammad Shahzad for the reply but issue is that when i use to access database on console there it works fine but when i use in dialplan here it not works

here is my console output
[root@localhost includes]# isql -v freeswitch
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> use test;
SQLRowCount returns 0
SQL> select * from tb_accounts;
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| id        | name                                                                                                                                                                                                                                                           | cash                    |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| 1         | shahzad                                                                                                                                                                                                                                                        | 10                      |
| 2         | saeed                                                                                                                                                                                                                                                          | 50                      |
| 3         | usman                                                                                                                                                                                                                                                          | 10                      |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
SQLRowCount returns 3
3 rows fetched
SQL> update tb_accounts set cash = cash -1 where id =1;
SQLRowCount returns 1
SQL> select * from tb_accounts;
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| id        | name                                                                                                                                                                                                                                                           | cash                    |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| 1         | shahzad                                                                                                                                                                                                                                                        | 9                       |
| 2         | saeed                                                                                                                                                                                                                                                          | 50                      |
| 3         | usman                                                                                                                                                                                                                                                          | 10                      |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
SQLRowCount returns 3
3 rows fetched
here u can see that update is also working, and here is my dialplan xml
        <document type="freeswitch/xml">
               <section name="dialplan" description="RE Dial Plan For FreeSwitch">
                     <context name="public">
                          <extension name="checkBalance">
                                <condition field="destination_number" expression="^126$">
                                     <action application="set" data="nibble_rate=0.03"/>
                                     <action application="set" data="nibble_account=1"/>
                                     <action application="answer"/>
                                     <action application="hangup"/>
                                </condition>
                          </extension>
                     </context>
               </section>
        </document>

i also check that the user and password and database is also correct.

any help is appreciated

Regards

Shahzad Bhatti

---------- Forwarded message ----------
From: Muhammad Shahzad <shaheryarkh@gmail.com>
To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org>
Cc: 
Date: Fri, 1 Mar 2013 17:07:39 +0100
Subject: Re: [Freeswitch-users] Error! Failed to log to database using nibblebill
Problem is with SELECT query, most likely db connection parameters are missing/invalid OR the db user configured does not have enough permissions to execute SELECT,

2013-03-01 22:29:52.293493 [ERR] mod_nibblebill.c:380 Error running this query: [SELECT `cash` AS nibble_balance FROM `tb_accounts` WHERE `id`=1]

Login db server from FS machine with same db user as configured in FS configs and run above query, it would give you hint on what is actually wrong.

Thank you.


On Fri, Mar 1, 2013 at 1:42 PM, Shahzad Bhatti <shahzad.bhatti@g-r-v.com> wrote:
hi
i am using a nibblebill  the call cost but have some problem in it. my nibblebill.conf.xml file is as

and console log is 


i got Error Failed to log to database! Doing update query 

reply me about the issue 

Regards

Shahzad Bhatti