[Solved] pull Else if from SQL [closed]


You need to learn the PHP from the basics. Learn about operators, PHP and HTML secion, etc..
Anyway, i fixed your code. The condition is if $vehicle->sold is not equal to 1. But i think, (in your OP you mentioned it should be 0) you want this: $vehicle->sold == 0

//Use sytnax like this. See php opeartors.
if ($vehicle->sold != 1) {
    ?> <!-- Close the php -->
    <div class = "foo">
        <div class = "fboverlay"></div>
            <a href = "https://stackoverflow.com/listing/<?= $vehicle->vehicle_id ?>"><img src = "/media.php?productId=<?= $vehicle->vehicle_id ?>&file=<?= $vehicle->main_image ?>" /></a>
    </div>
    <?php
    //Open the php again
} else {
    ?> <!-- close the php -->
    <a href = "https://stackoverflow.com/listing/<?= $vehicle->vehicle_id ?>"><img src = "/media.php?productId=<?= $vehicle->vehicle_id ?>&file=<?= $vehicle->main_image ?>" /></a>
<?php //Open again
}

5

solved pull Else if from SQL [closed]