Well, one way is to select all the items in the table, then loop through and see if item 2 is 1 item aver item 1, etc....
<?php
$conn = mysql_connect('localhost', 'username', 'password');
mysql_select_db('database', $conn);
$query = "SELECT `oid`
FROM `table`
ORDER BY `oid` ASC";
$result = mysql_query($query) or die(mysql_errno().': '.mysql_error());
$prev_oid = '';
$gaps = array();
while($row = mysql_fetch_array($result))
{
// If $prev_oid is empty, we're in the first iteration, no need to "look" for sequence
if(empty($prev_oid)) {
$prev_oid = $row['oid'];
continue;
}
if($row['oid'] != $prev_oid+1)
{
$gaps[] = $prev_oid . ' -> ' . $row['oid'];
}
$prev_oid = $row['oid'];
}
if(!empty($gaps))
{
echo 'There were some gaps!! They are listed below:<br />' . implode('<br />', $gaps);
}
Hope that helps somehow....
Please note that with large databases, this can really turn into a long task....
[ EDIT ] - Fixed coding issues...