dimanche 26 janvier 2020

display value of a row in different color based on value. like i want to display a row and when negative be in red

Those codes was working fine before, but now on one of my new site it doesn't i dont know why... please help me correct this :

"""

    <?php
    $db = mysql_connect('www.XXXXXXXX.com', 'XXXXXXX', 'XXXXXXXXX');
    mysql_select_db('XXXXXXXX',$db);

    $sql = "SELECT * FROM `Client` WHERE idClient='" . $_SESSION["idClient"] . "'";
    $req = mysql_query($sql)or die('Impossible de se connecter au serveur '.$sql.' '.mysql_error());


    while($data = mysql_fetch_array($req)) { 
        echo "
        <span style=\"color: ";
        if($data['account_status'] == 'NOT ACTIVATED') {
            echo 'red';
        } elseif($data['status'] == 'IN PROCESS') {
            echo 'orange';
        } elseif($data['status'] == 'ON WAIT') {
            echo 'blue';
        } elseif($data['status'] == 'ACTIVATED') {
            echo 'green';
        } elseif($data['status'] == 'EXCEEDED') {
            echo 'red';
        }
        echo '">'. $data['status'].'</span><br>';
    }
    echo '';
    mysql_close();
    ?>        

"""

Aucun commentaire:

Enregistrer un commentaire