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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Margaret MacDonald

    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.)
  • Margaret MacDonald

    #2
    Re: Can someone spot what I'm missing here...

    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:
    [color=blue]
    >...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[/color]

    --
    (To mail me, please change .not.invalid to .net, first.
    Apologies for the inconvenience.)

    Comment

    Working...