Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
| Search | Today's Posts | Mark Forums Read
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP 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 June 17th, 2008, 03:48 AM
Registered User
 
Join Date: Jun 2008
Location: HIgh Wycombe, Bucks, United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to wozza1664
Default PHP Pro Chap 3

Hi I have created the class files but when I run the scripts I get error messages

Notice: Undefined property: Organization::$name in /var/www/vhosts/phptest/warrentest/class.Organization.php on line 16
Call Stack

Notice: Undefined property: Individual::$firstname in /var/www/vhosts/phptest/warrentest/class.Individual.php on line 16

Notice: Undefined property: Individual::$surname in /var/www/vhosts/phptest/warrentest/class.Individual.php on line 16

And then nothing happens is there something that I have done wrong?
 
Old June 23rd, 2008, 03:05 PM
Registered User
 
Join Date: Jun 2008
Location: Ennepetal, NRW, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Scope Resolution Operator (::) is a token that allows access to static, constant, and overridden members or methods of a class.

What kind of visibility did you assign when declaring your properties?

The way you want to access them I suppose the declaration should be
Code:
public static $name
?

Best regards
Jörg




Similar Threads
Thread Thread Starter Forum Replies Last Post
php installation for win xp pro prash91 Beginning PHP 1 July 4th, 2007 08:05 AM
Pro PHP Chap 15 kgmcmillen Pro PHP 1 April 20th, 2006 02:38 PM
PHP and PayPal Pro harpua Pro PHP 1 September 19th, 2005 05:35 AM
Chap 9 - Charedit.php IP076 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 December 1st, 2004 08:17 PM





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