Jump to content

php


mssjdb

Recommended Posts

i am trying this http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-dynamic-poll-with-jquery-and-php/comment-page-2/#comments

But it not creating files votes.txt, and ips.txt files as well as it is showing error

Strict standards: Declaration of LikeWhereClause::testRow() should be compatible with WhereClause::testRow($row, $rowSchema = NULL) in C:\wamp\www\dynamic_poll\flatfile.php on line 568

 

How to solve this

Please help me

18945_.zip

Link to comment
https://forums.phpfreaks.com/topic/267859-php/
Share on other sites

(I (usually) do not follow links; and I (almost) never download attachments. I practice safe browsing.)

 

The error message is pretty clear. You have a class named WhereClause that has a method named testRow that is defined with two parameters. The first is $row and the second is $rowSchema with a default value of NULL.

 

In the file named flatfile.php you have defined a class named LikeWhereClause which is derived from the aforementioned class. In this class, at (about) line 568 you are defining (overloading) the aforementioned method (testRow) but have used a different signature --- meaning the number of parameters or their defaults are different (maybe the names have to be the same, too; I don't really remember).

 

Personally, I don't agree with this strict standard, but I'm sure that a lot of OOP purists do. I have never studied OOP in depth, though I have used it in several different languages. And I have a book on my shelf titled Object Oriented Design and Development, and that alone, qualifies me to say I don't agree  ;)

 

To fix this error, you will need to add the parameters to the method in the derived class so that the method signatures are the same.

Link to comment
https://forums.phpfreaks.com/topic/267859-php/#findComment-1374431
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.