0

Hi Everyone, I have been trying to find out what the problem is with this foreach but I am unable to...
Is there anyone who can me please

            foreach($results as $row);
                $dbcansecurecode = $row['securecode'];
                $dbcanactivated = $row['activated'];
                $dbcanpwdreset = $row['pwdreset'];

I have echo'd the results out for the foreach but I am still getting the error message -
Invalid argument supplied for foreach()

2
Contributors
2
Replies
5
Views
3 Years
Discussion Span
Last Post by everton.retweets
0

I wonder if that rogue semicolon one line 1 has anything to do with it. ;) My recommendation in general is to always use braces around a compound statement to avoid this and the next related error you're sure to encounter just by deleting that semicolon.

Edited by deceptikon

1

Sorted this problem now, the issue was with the

        $row  = $STM -> fetchAll();

I was only doing

        $row  = $STM -> fetch();
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.