Affirming the antecedent is a valid argument form which proceeds by affirming the truth of the first part (the "if" part, commonly called the antecedent) of a conditional, and concluding that the second part (the "then" part, commonly called the consequent) is true.

If P, then Q.
P.
Therefore, Q.

In logical operator notation, this is symbolized

Many people assume that this works the other way as well, so that one could say:

If P then Q.
Q.
Therefore P.

In logical operator notation, this is symbolized
where represents the logical assertion.

But this is a Logical fallacy called Affirming the consequent. Since P implies Q, but Q does not necessarily imply P.

You can see this if we simply substitute in actuall statements for P. and Q.

If there is fire here, then there is oxygen here.
There is oxygen here.
Therefore, there is fire here.

Sometimes P and Q entail each other, in that case we can say P if and only if Q. (Sometimes the shorthand P iff Q is used rather than writing out if and only if).