I have this sql query:
$sql1="SELECT articoli.sconto_st as promozione, marche.ID,marche.marca, categorie.ID,articoli.marche_ID,articoli.categorie_ID,categorie.categoria
FROM articoli,categorie, marche
AND articoli.categorie_ID=categorie.ID
AND articoli.marche_ID=marche.ID
AND marca='$marcavalue'
AND categoria='$categoriavalue'
";
$result1=mysqli_query($con,$sql1);
I want to output some of the datas:
<?php
while($row1=mysqli_fetch_array($result1)) {
echo "<tr>";
echo '<td class="tab1"><b>'. $row1["marca"] . '<b> '. $row1["promozione"].'</b> </br></td>'; //scala
echo "</tr>";
I want to select all of the data like in the query above but the promozione to output only if it is 1.So the other data to be selcted and outputted but the promozione to be outputed only if it is 1. When it is different from 1 to output just marca. Is there a way to do this?
</div>