Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP 5.3
|
BOOK: Beginning PHP 5.3
This is the forum to discuss the Wrox book Beginning PHP 5.3 by Matt Doyle; ISBN: 978-0-470-41396-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 5.3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 1st, 2011, 08:48 PM
Registered User
 
Join Date: Mar 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question CH 14 register.php not working

I have tried running the Chapter 14 register.php program and I am getting the following errors:

PHP Strict Standards: Non-static method Member::getByUsername() should not be called statically in C:\inetpub\wwwroot\wrox\ch14\book_club\register.ph p on line 104 PHP Strict Standards: Non-static method DataObject::connect() should not be called statically in C:\inetpub\wwwroot\wrox\ch14\book_club\Member.clas s.php on line 71 PHP Strict Standards: Non-static method DataObject::disconnect() should not be called statically in C:\inetpub\wwwroot\wrox\ch14\book_club\Member.clas s.php on line 79 PHP Strict Standards: Non-static method Member::getByEmailAddress() should not be called statically in C:\inetpub\wwwroot\wrox\ch14\book_club\register.ph p on line 108 PHP Strict Standards: Non-static method DataObject::connect() should not be called statically in C:\inetpub\wwwroot\wrox\ch14\book_club\Member.clas s.php on line 88 PHP Strict Standards: Non-static method DataObject::disconnect() should not be called statically in C:\inetpub\wwwroot\wrox\ch14\book_club\Member.clas s.php on line 96

I used the downloaded files from wrox website so does anyone have any ideal as to what changes need to be make to the Member.class.php and/or the DataObject.class.php programs to make things work?

I am running these programs on a Windows 2008 R2 virtual server with IIS, PHP 5.3, and MySQL 5.5 installed.

Thanks,

David Hicks JR.
 
Old June 14th, 2011, 11:54 AM
Registered User
 
Join Date: Jun 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

what I am going to suggest does not solve the warning it only prevents from showing, somewhere in your code you have the following:

parent::connect();

change it to this and the strict standard warning will dissapear:

@parent::connect();
 
Old July 31st, 2011, 01:36 PM
Authorized User
 
Join Date: Mar 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What you need to do is to declare those function to become static function.

PHP Code:
public static getByUsername 
I am assuming that all of the functions give error are just "public" function.

You can also create an instance of the class and use those function without any warning.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch.15 transact_user.php/Change my info not working djlfreak BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 2 May 12th, 2010 01:42 PM
Ch.15 transact_user.php/Change my info not working djlfreak BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 May 11th, 2010 12:32 PM
does not work register.php in ch 11 begining php5 tanvir_math BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 February 7th, 2007 05:03 PM
CH. 14 cart.php code problem shawnrberg BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 21st, 2004 05:44 PM
ch 13 enum_options.php not working thurmma BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 January 27th, 2004 04:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.