By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,231 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,231 IT Pros & Developers. It's quick & easy.

Can someone spot what I'm missing here...

P: n/a
....before I lose what remains of my mind?

The problem is that the tetragraph 'PPLL' is apparently not being
recognised for some reason I can't begin to see.

The test code is:

echo 'before the if: ' . $field[10] . '<br>' ;
if ( $field[10] == 'PPLL' )
{
echo 'IN the if: ' . $field[10] . '<br>' ;
}
echo ' at the switch: ' . $field[10] . '<br>' ;

From which the output is:

before the if: PPLL
at the switch: PPLL
Originally it was not being seen as a case inside a switch (mentioned
in the last test code line). So I copied it into an IF in front of
the switch as you see in the test code. But it's still not being
seen.

Whatever's going on must be something simple and very *very* stupid,
but for the life of me I cannot see it.

A million grovelling thanks to anyone who spots it.

Margaret
--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Found it. The database turns out not to be as clean as claimed: some
of the records still have extra spaces in some of the fields. Calling
trim() makes the problem go away.

*sigh*

I had written:
...before I lose what remains of my mind?

The problem is that the tetragraph 'PPLL' is apparently not being
recognised for some reason I can't begin to see.

The test code is:

echo 'before the if: ' . $field[10] . '<br>' ;
if ( $field[10] == 'PPLL' )
{
echo 'IN the if: ' . $field[10] . '<br>' ;
}
echo ' at the switch: ' . $field[10] . '<br>' ;

From which the output is:

before the if: PPLL
at the switch: PPLL
Originally it was not being seen as a case inside a switch (mentioned
in the last test code line). So I copied it into an IF in front of
the switch as you see in the test code. But it's still not being
seen.

Whatever's going on must be something simple and very *very* stupid,
but for the life of me I cannot see it.

A million grovelling thanks to anyone who spots it.

Margaret


--
(To mail me, please change .not.invalid to .net, first.
Apologies for the inconvenience.)
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.