I have a database table from which, when I select data with username and password, it works but when I insert some data in that table with same username and password it show
This is a permissions problem. Log into a MySQL prompt with the user the app is running as, and enter this query:
SHOW GRANTS;
This will show you the privileges (grants in MySQL-speak) that the current user has. My guess is that you won't see INSERT privileges for the given table. You will need the root user to grant you permission by running this query:
GRANT INSERT ON 'db'.'tablename' TO 'username'@'localhost'