hello i tried to switch from mysqli to pdo but somehow i made a mistake
MYSQLI
$qry = "SELECT * FROM con where id= '$user'";
$result = mysqli_query($conn, $qry);
while ($row = mysqli_fetch_assoc($result)) {
print_r($row["convoy_cars"], true);
if($row["convoy_cars"] == 1){
echo '<div class="dashtext-3">Autos für Spieler erlaubt: <a class="btn btn-sm primary rounded"><i class="fa fa-check-square"></div></i> </a>';
}
elseif($row["convoy_cars"] == 2){
echo '<div class="dashtext-3">Autos für Spieler erlaubt: <a class="btn btn-sm danger rounded"><i class="fa fa-times"></i></div> </a>';
}
print_r($row["convoy_hct"], true);
if($row["convoy_hct"] == 1){
echo '<div class="dashtext-3">HCT-Trailer erlaubt: <a class="btn btn-sm primary rounded"><i class="fa fa-check-square"></i> </div></a>';
}
elseif($row["convoy_hct"] == 2){
echo '<div class="dashtext-3">HCT-Trailer erlaubt: <a class="btn btn-sm danger rounded"><i class="fa fa-times"></i></div> </a>';
print_r($row["convoy_absicherung"], true);
}
if($row["convoy_absicherung"] == 1){
echo '<div class="dashtext-3">Absicherung: <a class="btn btn-sm primary rounded"><i class="fa fa-check-square"></i> </div></a>';
}
elseif($row["convoy_absicherung"] == 2){
echo '<div class="dashtext-3">Absicherung: <a class="btn btn-sm danger rounded"><i class="fa fa-times"></i></div> </a>';
}
}
my try in pdo
$qry = "SELECT * FROM con where id= '$user'";
$result = $pdo->prepare($qry);
while ($row = $qry->fetch(PDO::FETCH_ASSOC)){
print_r($row["convoy_cars"], true);
if($row["convoy_cars"] == 1){
echo '<div class="dashtext-3">Autos für Spieler erlaubt: <a class="btn btn-sm primary rounded"><i class="fa fa-check-square"></div></i> </a>';
}
elseif($row["convoy_cars"] == 2){
echo '<div class="dashtext-3">Autos für Spieler erlaubt: <a class="btn btn-sm danger rounded"><i class="fa fa-times"></i></div> </a>';
}
print_r($row["convoy_hct"], true);
if($row["convoy_hct"] == 1){
echo '<div class="dashtext-3">HCT-Trailer erlaubt: <a class="btn btn-sm primary rounded"><i class="fa fa-check-square"></i> </div></a>';
}
elseif($row["convoy_hct"] == 2){
echo '<div class="dashtext-3">HCT-Trailer erlaubt: <a class="btn btn-sm danger rounded"><i class="fa fa-times"></i></div> </a>';
print_r($row["convoy_absicherung"], true);
}
if($row["convoy_absicherung"] == 1){
echo '<div class="dashtext-3">Absicherung: <a class="btn btn-sm primary rounded"><i class="fa fa-check-square"></i> </div></a>';
}
elseif($row["convoy_absicherung"] == 2){
echo '<div class="dashtext-3">Absicherung: <a class="btn btn-sm danger rounded"><i class="fa fa-times"></i></div> </a>';
}
}