Ok, so it seems like the {total_results} was displaying incorrectly due to a bunch of loops stacking on top of each other…
Also, it seems like John is right about the reasons it wasn’t acting as expected, the quotes really seem to have helped.
I’m having just a slight problem left.
Here is my final code:
<?php
$test = "1";
?>
{exp:channel:entries channel="registrations" dynamic="off" author_id="CURRENT_USER" start_on="<?php echo $paramStart; ?>" stop_before="<?php echo $paramStop; ?>"}
<!--THIS RIGHT HERE IS JUST TO PRINT THE RESULT OF TESTING PURPOSES AND IT RETURNS THE CORRECT NUMBER OF ENTRIES-->
The total number of results is: {total_results}
<!--END-->
{if total_results > "2"}
<!--SO HERE I AM TRYING TO CHANGE THE VALUE OF THE VARIABLE CREATED BEFORE THE LOOP TO '0'-->
<?php
$test = "0";
?>
<!--END-->
First loop works
{/if}
{if total_results <= "2"}
<!--AND HERE I AM TRYING TO CHANGE THE VALUE OF THE VARIABLE CREATED BEFORE THE LOOP TO '1'-->
<?php
$test = "1";
?>
<!---->
Second loop works
{/if}
{/exp:channel:entries}
<!--SO THE LOOP ENDS AND NOW DEPENDING ON HOW THE $TEST VARIABLE HAS BEEN CHANGED THE SYSTEM IS TO DISPLAY ONE OF THE TWO OPTIONS-->
<!--THIS FOR SOME REASON DOESN'T GET CHANGED TO '0' AND CONTINUES BEING ONE EVEN THOUGH IT ENTERS THE FIRST IF STATEMENT IN THE LOOP ABOVE-->
<?php echo $test; ?>
<!---->
{if <?php echo $test; ?> == "0"}
<div>
Sorry, you've already entered more than 3 times this week
</div>
{if:else}
<div>
You are about to enter to win tickets for {event_title}. You can enter once a week, don't forget to try again next week!
</div>
{/if}
So my problem now is that for some reason my $test variable isn’t being changed within the loop, which in turn affects what option is displayed after the loop.
P.S. oh and thanks for help guys, i really appreciate it 😊