470,855 Members | 1,230 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

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

....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
1 1396
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.

Similar topics

12 posts views Thread by J. David Kent | last post: by
3 posts views Thread by JKop | last post: by
3 posts views Thread by Guy Penfold | last post: by
8 posts views Thread by Steven Spencer \(Spinalogic\) | last post: by
42 posts views Thread by NwsGrp1 | last post: by
2 posts views Thread by eloi-ribeiro.blogspot.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.