Marco Posted July 27, 2017 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 Link to comment Share on other sites More sharing options...
Larry Posted July 27, 2017 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). Link to comment Share on other sites More sharing options...
Marco Posted July 27, 2017 Author 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 Link to comment Share on other sites More sharing options...
Recommended Posts