Do u understand your code? I dont ...
First of all did u print_r this array ($results) to see what do u have in it?
Second of all why do u count your fields number you dont use it?
$totalFields = mysql_num_fields($result);
This is a tip when u query ...
Write your query ...
$query = "SELECT * FROM products WHERE id!='$newarrival_id'";
Send it to mysql and check it for errors
$result = mysql_query($query) or die(mysql_error());
/* Check if there are affected rows (if your query returns results) */
if (mysql_num_rows($result)) {
/* grab results in an array */
while ($sc=mysql_fetch_assoc($result)) {
$my_arr[] = $sc;
/**
* In your case u need an array with your ID's
* so u catch
* $my_arr[] = $sc['ID'];
*/
}
}
In the end u should have an array of ID's:
$my_arr = array (
0 => 1
1 => 5
...
n => m
);
something like this.
When u check this:
if ( in_array( $fetured_id, $my_arr) ) {
$clas = "admin_prod";
}else{
$clas = "admin_prod1";
}
if $fetured_id is in $my_arr array that should return true else return false ...
NOW, look at your array is it like the array I told u to create it?