Re: Have I learned nothing .> Foreach()
| From: | Marek Kilimajer | Date: | Tue, 30 Nov 2004 11:55:02 +0000 |
| Subject: | Re: Have I learned nothing .> Foreach() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203124@lists.php.net to get a copy of this message | ||
Stuart Felenstein wrote:
I thought this one was under my control. Apparently not. I'm getting a "Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/mypage.php on line 143 First, I have 3 form elements school[] school[] school[] Here is how I initialize the session variable (after user it's submit): $_SESSION['schools'] = $_POST['school'];print_r($_SESSION['schools']); here
Then finally on the transaction page, some pages down the road:and also print_r($_SESSION['schools']); here
foreach($_SESSION['schools'] as $school) { $query = "INSERT INTO mytable (ProfileID, School) VALUES ($LID, '$school')"; $res6 = run_query($query); }What have you find out?
I can't for the life of me find the issue here. Any pointers / help would be greatly appreciated. Stuart