samedi 28 avril 2018

why the outputs are different in the while loop

while($car_result1 = mysqli_fetch_object($car_connect1)){

<div class="portfolio all" data-cat="all">

<? echo $car_result1->car_gear; ?>  // output is stick

<img alt="Ay <?php if($car_result1->car_gear='auto'){ echo "Auto"; } else { echo "Stick"; };  ?> ">

<? echo $car_result1->car_gear; ?> // Output is Auto 

}

car_gear field is filled as "stick" in the database. after the image tag, car_gear output changed as "Auto"

Why the result $car_result1->car_gear; change from "stick" to "Auto" ?

Aucun commentaire:

Enregistrer un commentaire