This code displays a list of all the names that are stored in the database in the table "entries".
I have a list of 200 names. The top 20 is marked in green. Last 20 red. Others are blue.
$position=0;
$upit = mysql_query("SELECT * FROM entries ORDER BY votes DESC");
//This is now an array of the data
while ($model = mysql_fetch_array($upit)) {
$position++;
$data = unserialize($model['data']);
$max = mysql_num_rows($upit);
$max = $max - 20;
if ($position < 21){
echo " <font color=#008000> ".$position." ) ".$data[6]['value']." ( ".$model[votes]." ) </font>";
} elseif ($position <= $max) {
echo " <font color=#000080> ".$position." ) ".$data[6]['value']." ( ".$model[votes]." ) </font>";
} else {
echo " <font color=#FF0000> ".$position." ) ".$data[6]['value']." ( ".$model[votes]." ) </font>";
}
}
This CODE displays a list in the following way
1. Novak Djokovic (1342)
2. Rafael Nadal (1234)
3. Roger Federer (1002)
4. Name 4 (990)
5. Name 5 (899)
6. ...
Now I want to out of list two names from the list but they are not deleted from the database. Each name has its own unique ID in the table "entries" a field called "entries_id".
For example, I want to Out of list Novak Djokovic whose "entries_id" is "150" and Roger Federes hose "entries_id" is "92"