Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2daff3cdc6
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (33 sloc) 0.857 kb
<?php
include_once( 'common.php' );
if (! isset( $_POST['ids'] )) {
fail( 'Required parameter not set' );
}
$_DB = new mysqli( $_MYSQL_HOST, $_MYSQL_USER, $_MYSQL_PASS, $_MYSQL_DB );
if (mysqli_connect_errno()) {
fail( 'Error connecting to db: ' . mysqli_connect_error() );
}
$ids = explode( ',', $_POST['ids'] );
foreach ($ids AS $id) {
switch ($id{0}) {
case 'r':
$table = 'reviews';
break;
case 'q':
$table = 'requests';
break;
case 'n':
$table = 'newbugs';
break;
case 'd':
$table = 'changes';
break;
case 'c':
$table = 'comments';
break;
}
$rowId = intval( substr( $id, 1 ) );
$_DB->query( "UPDATE {$table} SET viewed=1 WHERE id={$rowId}" );
}
$_DB->close();
?>
Jump to Line
Something went wrong with that request. Please try again.