I am using PHP and mysql. I need to write javascript functions where i can fetch data from mysql database and display in a table and later do some calculations with those values. Please help me regarding the code required to connect to mysql database.

Or if there is a possibility of executing php statements and accessing the variables where the results are pointed, i can write php statements in javascript.

Please reply soon