I am trying to exclude the an 'ID' from the Mysql_query but it is still returning the mentioned ID. This ID is '21' but the query returns '21' which is not what I wanted. Did I misspell something in the Mysql?
("SELECT * FROM `gallery` WHERE `gallery_id` NOT IN ('$notgallery')") or die (mysql_error());
function not_gallery($pic){
$pic = $_GET['id'];
$id = explode(".", $pic);
$notgallery = $id;
$notg = mysql_query("SELECT * FROM `gallery` WHERE `gallery_id` NOT IN ('$notgallery')") or die (mysql_error());
while($not_row = mysql_fetch_assoc($notg)){
$notgimage[] = array(
'id' => $not_row['gallery_id'],
'user' => $not_row['user_id'],
'name' => $not_row['name'],
'timestamp' => $not_row['timestamp'],
'ext' => $not_row['ext'],
'caption' => $not_row['caption'],
);
}
print_r($notgimage);
}
I print_r'ed the query and it is still returning '21' which I have excluded/or which I thought I did
Array ( [0] => Array ( [id] => 21 [user] => 18 [name] => NotDeojeff [timestamp] => 1367219713 [ext] => jpg [caption] => asd ) [1] => Array ( [id] => 22 [user] => 18 [name] => NotDeojeff [timestamp] => 1367225648 [ext] => jpg [caption] => Ogre magi )