Wednesday, 15 June 2011

php - Getting 500 internal error by using recursive function -


I get an internal error while calling under the recursive function.
Function Reference ID (A type of parent ID) In ​​the matrix table, if reference ID is available then the performance in the matrix table should be returned to that ID, but if the ID is not found in the matrix table, then that reference reference id (Enroller_id) from the members table of that old reference ID (stored in $ Ref_id) and call that function again and continues to call it until it Elegant ID is not available is not available or in the matrix and in the end that did not get it the default ID ($ default_ref_id) return.

But I do not know why I am getting an internal server error, I have tried even max_execution_time by maximizing 30 to 50 or 100 but it can not be fixed.

Please be good if you can get help from me that I have been stuck with this issue since the last 3 to 4 hours.

Here is the function I created in:

  function findR EferralMember ($ ref_id) {$ default_ref_id = 1; $ Count_ref_member = GetSingleValue ("Matrix", "Calculation (*)", "Member_ID = '" $ Ref_id. "'"); If ($ count_ref_member> gt; 0) {Return $ ref_id; } And {$ ref_id = GetSingleValue ("members", "enroller_id", "member_id = '" $ Ref_id. "'"); FindReferralMember ($ REF_ID); } Return $ Default_ref_id; }  

Your code is in the endless loop. $ count_ref_member is calling find referral message again again for each call find referralmail for the

The variable is never greater than zero. This endless loop is never returning, and eventually exits the stack on the server, returning this 500 error message.

Trace through your code and see why this infinite loop is happening. Fix endless loop and 500 error will end.


No comments:

Post a Comment