I need a PHP script to take the following Select statement:
Select Contribs.`ContribID`, Contribs.`IndivID`, Contribs.`ContribDate`, Contribs.`ContribAmt`, ContribTypes.`ContribID`,
ContribTypes.`Contribname`, IndivID.`IndivID`, IndivID.`Fname`, IndivID.`Lname`, Families.`FamID`,
Families.`Add1`, Families.`City`, Families.`State`, Families.`Zip` From
Contribs Contribs, ContribTypes ContribTypes, IndivID IndivID, Families Families
Where ([url removed, login to view] = [url removed, login to view] And [url removed, login to view] = [url removed, login to view] And [url removed, login to view] = [url removed, login to view])
along with necessary order clause to properly sort data and output a pdf file consisting of a page or pages (if necessary) for each person (IndivID) listing each contribution(contribution type and amount) in date order (contribdate) with a subtotal at the end of each month and a total at the end of each person. The top of each page should include Church name & address (will be located in PHP Session variables) and the persons name ( Fname and Lname) and address(add1, city, state, & zip). If multiple pages are required for a person, "Page 1 of x" verbage should be included at the bottom of each page. After the pdf file is created, it should be displayed in the web browser which the user can then download to his local computer.