i have a database consists of4 fields for example:
name date Description Amount
Ali 05/04/2012 Salaries 2000$
Ali 08/04/2012 commission 100$
ALi 11/04/2012 Transport 100$
Ali 05/05/2012 Salaries 2000$
Ali 08/05/2012 commission 100$
ALi 11/05/2012 Transport 100$
in case i need to retrieve information and inquiries about the salary page , for Ali Only i need the statement of each month to be separately by separate line and sum of the total amount during that month
i need to know how to do this in mysql PHP Script .
while this does not relate to your question, but to correct you.
i have a database consists of4 fields for example:
you are referring the table as database. please correct it. it is not database as a whole but a table within a database.
you are missing primary keys in your table
it is always good to have a primary key for each and every table, mainly because primary key uniquely identifies each row in the table. here is good explanation on why you should always use primary keys in your table Should each and every table have a primary key?
2000$
you don't need a dollar symbol at the end of integer value. since the database does not have any special meaning for that symbol, and by using this you will loose the ability of some calculation that database could have performed for you. since 2000$
is not same as 2000
if you want database to perform the calculation store only integers. if you want to store the symbol too then you can store it in another column.