Hi all

I recently set up a photo gallery which shows photos on the page from a php script from the DB:
Code PHP:
$sql = "SELECT pid, views FROM photos WHERE name='" .mysql_real_escape_string($_GET['name'])."' ORDER BY pid ASC"
echo '<a'.$class.' rel="lightbox" href="/images/.....

I've set each img to display in a js lightbox window when clicked, my problem is, how can I update my db.table.views by running some ajax every time a photo is viewed/clicked?

Making sense?

One of the php guys suggested, create a update file & hidden div and link it to the img:

If you add a class of gallery to your image tag, you could use something like this. Untested, but it should give you a general idea of what you need to do. You'd also need to create a hidden DIV somewhere on your page and replace id_of_hidden_div in the code to match the ID of the DIV.
Code JavaScript:
$("img.gallery").click(function() {
    $("#id_of_hidden_div").load("update.php?img=" + $(this).attr("src"));

Not sure if this will work(don't understand it) I'm using Slimbox v2.02 for jquery???

Any suggestions?