Opinion by
Orlady, P. J.,In Goodwin v. Bradford City Council, 248 Pa. 453, the constitutionality of the Act of July 24, 1913, P. L. 960, under which this plaintiff seeks to recover, was sustained. ' Upder the authority given by that act the mayor of the *69city on January 5,1914, appointed the plaintiff inspector of weights and measures, and his right to do so is not challenged. On the same day the mayor notified the city council of the appointment, and requested that body to make the necessary appropriation for the salary of his appointee. On August 21, 1914, the council not having taken any action on the mayor’s notice and request, the plaintiff presented his petition to the Court of Common Pleas of the county for a mandamus to compel the council to fix the salary and make an appropriation for its payment from January 5, 1914.
An alternative writ was awarded, an answer filed, to which the relator filed a general demurrer, and after full argument, a peremptory writ of mandamus issued commanding the council to enact an ordinance fixing suitable compensation for the salary according to law, and make an appropriation therefor, the court reserving for future consideration whether or not the relator is legally entitled to any compensation from the date of his appointment to the said office on January 5, 1914, to the date of the order, to wit, April 5, 1915.
On May 3, 1915, the city council, by proper ordinance fixed the salary of the inspector of weights and measures at the sum of one thousand dollars per year, payable in monthly installments, and, on the same day, by a separate ordinance, made an appropriation of the sum of seven hundred and fifty dollars for the payment of the salary of the officer “for the balance of the current fiscal year.”
On May 6th the relator presented another petition, asking the court “to ascertain and fix his damages,” and modify the order of April 5th, so as to include the amount of his salary — by way of damages, from the date of his appointment.
This was refused in an opinion filed, holding that inasmuch as during the period for which the salary is claimed, there was no ordinance fixing it, or appropriating any money for its payment, the relator was not entitled to recover.
*70The Act of July 24, 1913, does not fix the amount of the salary and affirmative action by the council was necessary before the relator was entitled to any salary. The Act of June 27,1913, P. L. 568, specifically prohibits the payment of any money “unless the same shall have been previously appropriated by the council for the purpose for which it is to be drawn.”
While the relator filed a replication to the answer of respondents, he made his right to judgment depend on filing a demurrer, thereby admitting all the material facts set forth in the respondent’s answer and return. These deny in direct words the facts, which the relator must establish before he can have judgment, and the denial is as broad as the allegation of the petition: Commonwealth, ex rel., v. Dickinson, 83 Pa. 458.
While a demurrer admits all matters sufficiently pleaded, the court will consider the whole record in rendering judgment and see that substantial justice is done: Cunningham v. Dunlap, 242 Pa. 341.
It must be conceded that the relator’s right to receive salary of any amount depends, first, on his nomination by the mayor, and second, the fixing of the amount of that salary by the council — each is as controlling as the other, and until the council fixes the salary there is no method provided by law to determine its amount or manner of payment. The right to appoint the officer is vested in the mayor, by the Act of 1913, and he is an officer de jure by that appointment; the right to receive a definite salary is made to depend upon the action of council. This right may be enforced by mandamus, as shown by Goodwin v. Bradford City Council, supra — “Council has no voice whatever in making this appointment, but when made it is their duty to adopt an ordinance fixing the compensation of the appointee, which the Act of 1913 provides shall not.be less than one thousand dollars per annum,” and until action was taken by council, the relator took the risk, and acted without the right to receive salary. The time, when his right to receive salary came *71into existence was when it was fixed by the body charged by law with that duty.
An officer to whose office no compensation has been attached by law, may not bring an action for services rendered — 29 Cyc. 1367, and cases cited. Tronp on Public Officers, Sections 446-447.
One of the rights commonly accorded to officers, is the right to compensation, fees, emoluments, etc., but only where provision is made by law for such compensation, and it follows, that an officer has no claim for services rendered, where no provision has been made by law for compensation for such services, and the performance of the duties gives the incumbent no claim for official compensation: Riddle v. Bedford County, 7 S. & R. 386; Commonwealth, ex rel., v. Slifer, 25 Pa. 23; Philadelphia v. Given, 60 Pa. 136. Nor is the rule a harsh or unjust one; he volunteered to perform the services knowing that council had control over the amount of his salary. His acts were good as to third persons who had an interest in the act done, but he could not recover any salary for his official services, until it was fixed by council: Luzerne County v. Trimmer, 95 Pa. 97; Brower v. Kantner, 190 Pa. 182; Robbins v. Wilkes-Barre, 37 Pa. Superior Ct. 382.
When a public officer claims a salary, fees or compensation for services rendered to the public, he must show an act of assembly giving it. If he cannot show such act, he cannot recover: Rothrock v. School District, 133 Pa. 487.
The ordinances fix the time when the relator’s salary began to run, its amount and manner of payment, further than so fixed he is not entitled to recover.
The judgment is affirmed.