while(($row = mysqli_fetch_object($abfrage)) || ($i < $aps+1))
{
$aid = $row->ID;
echo "<td width=488px>";
echo "<img style='max-width:488px;' src='";
echo $row->bildURL;
echo "'>";
echo "<h3 style='padding-left: 20px; padding-top: 5px;'>";
echo $row->name;
echo "</h3>";
echo "<h3 style='padding-left: 20px;'>";
echo $row->preis;
echo "€</h3>";
echo "<form action='' method='post'>";
echo "<input type='submit' name='ausfuehren";
echo $lol;
echo "' value='In den Warenkorb'/>";
echo "</form>";
if(isset($_POST["ausfuehren$lol"])) {
$warenkorb = $_SESSION['warenkorb'];
$warenkorb[] = $aid;
$_SESSION['warenkorb'] = $warenkorb;
}
echo "</td>";
$lol++;
};