Re: [PHP] Differences in arrays

2004-12-02 Thread Mike Smith
How about: if ( is_array($_SESSION['schools'] ) ) { foreach($_SESSION['schools'] as $h) { If($h!=){ //First added line $query = INSERT INTO Prof_Schools (ProfID, School) VALUES ('$LID', '$h'); $res6 = run_query($query); echo $query; } //End added line } } -- PHP General Mailing List

Re: [PHP] Differences in arrays

2004-12-02 Thread Stuart Felenstein
--- Mike Smith [EMAIL PROTECTED] wrote: How about: if ( is_array($_SESSION['schools'] ) ) { foreach($_SESSION['schools'] as $h) { If($h!=){ //First added line $query = INSERT INTO Prof_Schools (ProfID, School) VALUES ('$LID', '$h'); $res6 = run_query($query); echo $query; } //End

Re: [PHP] Differences in arrays

2004-12-02 Thread Mike Smith
Yes, I did that and it works correctly now. I was tryin g to better understand why the difference in the behaviour. Stuart The first array is created by selecting individual elements from a muli-select list (My multi-select is a little hazy, but I think it's something like...) select

RE: [PHP] Differences in arrays

2004-12-02 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 02 December 2004 10:26, Stuart Felenstein wrote: I have arrays set up in a user form. One type is from a multi-select list. [] I have 3 textfield elements all named

Re: [PHP] Differences in arrays

2004-12-02 Thread Richard Lynch
1-I guess I need a way to make sure in the foreach that when the first empty element is reached the loop dies. Just to be sure you understand: You should really not die when you hit a blank. You should just SKIP it and process the rest. A user *might* choose to fill in the first and third