Reply to Re: Extending the mysqli class

Your name:

Reply:


Posted by peter on 02/25/07 17:37

> Actually, PHP4 does support the mysqli object, also.
>
> But in PHP5 your constructors are named __construct, not the class name.
> So you need to change the constructor name in your class, and call
>
> parent::construct(...)

Also just thought of another clarification. If you do not declare a
constructor for a class that extends another class, the parent constructor
will be called. for example the following code snippet will output "parent
constructor and the input was THIS TEXT":-

<?php
class c1
{
function __construct($input)
{
echo "parent constructor and the input was ".$input;
}
}
class c2 extends c1
{
}
$c = new c2('THIS TEXT');
?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация