Nieuw lid |
|
Beste.
Ik heb het gedaan dat wanneer iemand op een foto klikt er in de sql een update gemaakt wordt. Ik kan zo bijhouden wie het meest bekeken wordt.
Het probleem:
Als je ergens op klikt, dan update hij MEERDERE dingen!!!
Ik heb hem op 'id' staan welke UNIEK is per ding maar toch update hij meerdere dingen!
Iemand hier die ziet wat er verkeerd is?
Mijn code:
<div id="logo_box"><?php echo '<a href="'.$large[0].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[0].'"').'"><img src="'.$foto[0].'" alt="'.$titl[0].' door: '.$kstn[0].'" width="170px" height="146px" border="0" /></a>'; ?></div>
<div id="logo_box_spacer"></div>
<div id="logo_box2"><?php echo '<a href="'.$large[1].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[1].'"').'"><img src="'.$foto[1].'" alt="'.$titl[1].' door: '.$kstn[1].'" width="170px" height="146px" border="0" /></a>'; ?></div>
<div id="logo_box_spacer2"></div>
<div id="logo_box3"><?php echo '<a href="'.$large[2].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[2].'"').'"><img src="'.$foto[2].'" alt="'.$titl[2].' door: '.$kstn[2].'" width="170px" height="146px" border="0" /></a>'; ?></div>
<div id="logo_box_spacer3"></div>
<div id="logo_box4"><?php echo '<a href="'.$large[3].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[3].'"').'"><img src="'.$foto[3].'" alt="'.$titl[3].' door: '.$kstn[3].'" width="170px" height="146px" border="0" /></a>'; ?></div>
<div id="logo_box_spacer4"></div>
<div id="logo_box5"><?php echo '<a href="'.$large[4].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[4].'"').'"><img src="'.$foto[4].'" alt="'.$titl[4].' door: '.$kstn[4].'" width="170px" height="146px" border="0" /></a>'; ?></div>
<div id="logo_box"> <?php echo '<a href="'.$large[0].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[0].'"').'"><img src="'.$foto[0].'" alt="'.$titl[0].' door: '.$kstn[0].'" width="170px" height="146px" border="0" /></a>'; ?></div> <div id="logo_box_spacer"></div> <div id="logo_box2"> <?php echo '<a href="'.$large[1].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[1].'"').'"><img src="'.$foto[1].'" alt="'.$titl[1].' door: '.$kstn[1].'" width="170px" height="146px" border="0" /></a>'; ?></div> <div id="logo_box_spacer2"></div> <div id="logo_box3"> <?php echo '<a href="'.$large[2].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[2].'"').'"><img src="'.$foto[2].'" alt="'.$titl[2].' door: '.$kstn[2].'" width="170px" height="146px" border="0" /></a>'; ?></div> <div id="logo_box_spacer3"></div> <div id="logo_box4"> <?php echo '<a href="'.$large[3].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[3].'"').'"><img src="'.$foto[3].'" alt="'.$titl[3].' door: '.$kstn[3].'" width="170px" height="146px" border="0" /></a>'; ?></div> <div id="logo_box_spacer4"></div> <div id="logo_box5"> <?php echo '<a href="'.$large[4].'" rel="lightbox" onclick="'.mysql_query('UPDATE site_products SET bekeken = bekeken +1, last_bekeken = NOW() + INTERVAL 1 MINUTE WHERE id = "'.$which[4].'"').'"><img src="'.$foto[4].'" alt="'.$titl[4].' door: '.$kstn[4].'" width="170px" height="146px" border="0" /></a>'; ?></div>
|