Jump to content

foreach function error


kabucek

Recommended Posts

hello @LL,

 

 

We have registration system and it was working on ok up till now.

When someone tries to register for our event there is an error message:

 

 

warning: invalid argument supplied for foreach() in /home/dir1/dir2/indexReg.php on line 5400

 

the code from line is:

 

foreach ($classSelectionArray as $classID => $selectionStatus)

 

 

and there is another message:

 

processTemplateArray: input is not a record array

 

 

Our php framework is hosted on webhosting company which has centos.

Is it possible that they run some update for php services which caused

bad interactions with "foreach" function? maybe older version of php or

some respository of it handles this differently ?

 

thanks

 

Link to comment
Share on other sites

 

i digged into the changes and revert old change and now I got similar error but for next lines:

 

 

 

Warning: Invalid argument supplied for foreach() in /home/dir1/dir2/indexRegEG.php on line 10833

 

 

code:

 

foreach ($tmpPeriodArray as $label=> $itemArray)

 

 

any suggestions?

 

Link to comment
Share on other sites

foreach ($eventPeriodListArray as $label => $periodArray)

							{

								if ($allowedDaysArray[$periodArray['myeventDayNumber']]=='true')

									{

										$availablePeriodListArray[$inx]=$periodArray;

										$inx++;

										}

								}

					$eventPeriodListArray=$availablePeriodListArray;

					$tmpPeriodArray=$seminarPeriodListArray;

                  var_dump($tmpPeriodArray);     
				foreach ($tmpPeriodArray as $label=> $itemArray) 

					{

						//init

							$eventID=$eventRecordArray['itemID']; 

							$eventPeriodID=$itemArray['itemID'];

						//format out the period TIME display

							$dayName=dayNameFromevent($itemArray['eventDayNumber']);

							$startTime=date("h:i a", $itemArray['scheduleStartSecond']+$timeOffset);

							$endTime=date("h:i a", $itemArray['scheduleEndSecond']+$timeOffset);

							$seminarPeriodListArray[$label]['showTime']="

								$dayName $startTime - $endTime

								";

 

 

 

is this helpful ?

there is more than 10,000 lines of code so if you tell me which section you want i will post it

thanks again for help !!

Link to comment
Share on other sites

is this helpful ?

 

Not really.

 

Now we need to know how $seminarPeriodListArray is created.

 

Seriously, you need someone who knows php to take a look at the code. And I don't just meen post the lot on a forum. If your unable to narrow the problem down were just going to go around in circles.

 

ps: 10000 lines of code in one file doesn't say much for this applications design. I should imagine this might be a bit of a nightmare to debug.

Link to comment
Share on other sites

 

 

	foreach ($seminarPeriodListArray as $label => $periodArray)

							{

								if ($allowedDaysArray[$periodArray['maniaDayNumber']]=='true')

									{

										$availablePeriodListArray[$inx]=$periodArray;

										$inx++;

										}

								}

					$seminarPeriodListArray=$availablePeriodListArray;

 

thanks for help

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.