dennis dennis - 6 months ago 31
PHP Question

php Using if is not changing?

If the

the result is always warning. How is that possible? Am I using the
right? Maybe someone can help me with it. The
is coming from a database. Can you explain whats the difference between

Thanks sincerely Dennis

<?php if ($status == "pending") {
$class ="warning";
} else if ($status == "succes"){
$class = "succes";

Answer Source

To answer your 2nd Question:
A single = is for asigning a value to a variable.

variable = "test"

Double == is for comparing

1 == 1 // True

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download