First off
PHP Code:
$fv= $DB_site->query("SELECT gallery_views FROM gallery_index WHERE gallery_id='$id'");
$views=$DB_site->fetch_array($fv);
is a waste of a query as it is getting data that already exists.
Also you don't need any quotes at all
PHP Code:
gallery_views=gallery_views+1
will suffice, and where in the script are you definning the $id, and does everything display correctly just the views will note update?
Only reason I can see that the data doesn't update correctly is that the url is not yourscript.php?view=gal, other then that it should update, unless you also defined the templates to eval elsewhere. You can free the memory that is used by the query after the while loop
PHP Code:
$DB_site->free_result ( $fgall ) ;
Cheers,
g-force2k2