wenn $_GET['buy'] deine ID ist, dann solltest du die doch auch im Update Statement verwenden...
gruss
gruss
"UPDATE naviartikel SET TimesViewed=TimesViewed+1 WHERE ID=$buy");
Fehler
"UPDATE naviartikel SET TimesViewed=TimesViewed+1 WHERE ID=$_GET['buy']";
Fehler
mysql_query("UPDATE naviartikel SET TimesViewed=TimesViewed+1 WHERE ID=".$_GET['buy']."");
mysql_query("UPDATE naviartikel SET TimesViewed=TimesViewed+1 WHERE ID=".intval($_GET['buy'])."");
$_SESSION['cart'][0]
<pre>
<?php
$a = $id;
var_dump ($a);
?>
</pre>
$sql= ("UPDATE naviartikel SET TimesViewed=
TimesViewed+1 WHERE ID=".intval($_GET['buy'])."");
header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
session_start();
if (!isset($_SESSION['cart'])) {
$_SESSION['cart'] = array();
}
if (isset($_GET['buy'])) {
$_SESSION['cart'][] = $_GET['buy'];
header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);
exit();
}
echo '<td>' . $id . '</td>';
echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?buy=' . $id .'">
bestellen</a><td>';
$sql= "UPDATE naviartikel SET TimesViewed=TimesViewed+1
WHERE ID= $id ";
Kommentar