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
--- 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
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
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
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
5 matches
Mail list logo