Forum Moderators: coopster

Message Too Old, No Replies

function recall problem

         

akswithsim

9:03 am on Jul 6, 2009 (gmt 0)

10+ Year Member



Hi ,

I am using a function addMember() that include several other functions and processes.

My problem is that after completion of whole process php automarically recall addMember function again.

I am not calling addMember() function recursively anywhere.
I am very much sure about that.

Is it a PHP bug?
please help me. How to fix this issue?

Note: Memory usage at the end of process: 1,803,334 bytes

andrewsmd

7:56 pm on Jul 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your code with all of the functions and where you call it function so we can see if you are unintentionally calling it again or not.

eelixduppy

11:58 pm on Jul 6, 2009 (gmt 0)



Also check your include files to make sure that you aren't calling it again anywhere. Last thing I can think of is to make sure that your loops are iterating the correct number of times instead of one additional time at the end. Seems like a simple logic error going on here, and unfortunately, the hardest kind to find.

akswithsim

7:50 am on Jul 7, 2009 (gmt 0)

10+ Year Member



I can't copy paste complete code because complete code is of about 2000+ lines.

I can describe it's struture.
-------------------------------------
filename: payment.php
-------------------------------------
include 'config.inc.php'; // connects to mysql
include 'include_files.php';// consists of all functions...

function add_member($post,$comingFrom)
{
... insert record to mysql table
... send sms to that user
... send email to that user
... charge money
... assignPosition($memberId);
}

-------------------------------------------------------
// About assignPosition() function
This function include several other functions to assign a position to that reg. member.
But I am not calling add_member() function anywhere in the code.

This recursive error is not occurring everytime! (70%-30%)