I have a line of code that has me going crazy Im a newbie need some help

For this partial code here
[php]<?php
if(!(include LIBDIR . ‘mysql15.php’)) return 0;
class MySQLu_class extends MySQL1_class
{[/php]

I get this error in my email
Error #2048 ---------> An error occurred in script /hermes/bosoraweb168/b1010/dom.il60302/cgi-bin/php/jtpr/mysqlu5.php on line 3 : Declaration of MySQLu_class::conect() should be compatible with that of MySQL1_class::conect() .
Context: Array

What does this mean and how do I fix it? :o :o

The class is extending another class. To do this properly, ALL function signatures in the extending class must match the already-existing functions if they exist.

For example, if you have this:
[php]class Foo {
function bar(stdClass $baz) {
}
}[/php]

And you try to do this:

[php]class Foobar {
function bar(DOMNode $bazt) {
}
}[/php]

PHP will throw the very error you’ve received. The signature of a function is the order, type and variable names of arguments that it receives. It needs to match across the extension chain for public methods of a class.

Sponsor our Newsletter | Privacy Policy | Terms of Service