Marco 0 Posted July 27, 2017 Report Share Posted July 27, 2017 Hi, in PHP Advanced, 3rd edition, script 9.8, pages 306-7, step 3 - "Fetch the results and display them", Larry says that the loop creates a new Page object - $page - that can be invoked by the Page class methods. I don’t understand how and where the new Page object - $page - gets created, as I cannot find a new keyword. Could you please help me? Thanks, Marco Quote Link to post Share on other sites
Larry 428 Posted July 27, 2017 Report Share Posted July 27, 2017 Hey Marco, Sorry for the confusion! Line 20 sets the fetch mode to fetch records as objects of type Page. So the while loop assigns each row to the $page variable which is then an object of type Page (because of the fetch mode). Quote Link to post Share on other sites
Marco 0 Posted July 27, 2017 Author Report Share Posted July 27, 2017 (edited) Thank you so much Larry, I really got lost, but now it is clear. Also thanks for you early reply. Edited July 27, 2017 by Marco Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.