I am not able to get the warning the sql query is working and mysqli_query() returns 1 and each time my database is also being updated . What is the problem?
According to another question here :
The INSERT
command will return a boolean(true/false), So you must use select command to get the required result
The error that you're getting is because the INSERT query failed, so mysqli_query() has returned false to indicate that the query has failed. A successful query would have returned a mysqli_result() object. Check the contents of $sql1 for anything like syntax errors.
You can use mysqli_error() after the insert query to get the error that's being returned by MySQL.
btw, you're wide open to SQL Injection attack! The value for $tval is coming straight from the user without any attempt to validate or sanitize it! You should use prepared statements.