PHP if statement not listening..

I feel like a dummy who has never written and if statemnt before but this baffles me…

I have this if statement:

if ($row[‘auto_fetch_flag’] == “1” );
{
echo ("We will auto fetch data for you ");
echo $row[‘auto_fetch_flag’];
}

Here is the output:
We will auto fetch data for you : 1
We will auto fetch data for you : 0
We will auto fetch data for you : 1
We will auto fetch data for you : 1

if I change it to:

if ($row[‘auto_fetch_flag’] == “ThereisnowaythatthedatabasefieldwouldeverbeequalToThis” );
{
echo ("We will auto fetch data for you ");
echo $row[‘auto_fetch_flag’];
}

Here is the output:
We will auto fetch data for you : 1
We will auto fetch data for you : 0
We will auto fetch data for you : 1
We will auto fetch data for you : 1

So the If statement runs regardless of that conditions…any ideas?

That can’t be you’re whole code and/or that wouldn’t produce the results that you have listed in that setup.

You are terminating the statement.

if (condition)
{}

Not

if (b);

Sponsor our Newsletter | Privacy Policy | Terms of Service