I have a problem deleting rows from table with parameters. Here is the code:
if ($dbProductImageIdNumber) { $ImagesToDeleteNumber = $dbProductImageIdNumber -1 - $numItemImages; echo "$dbProductImageIdNumber" . ' '; echo "$numItemImages" . ' '; echo "$ImagesToDeleteNumber" . ' '; echo 'Deleting'; mysql_query("DELETE FROM wp_posts WHERE post_parent = '$dbProductId' ,ID != '$dbProductThumbnail'"); } Problem is that != seems to be understood wrongly, maybe I'm dooing syntax mistakes?
Will apreciate any help.
-----EDIT-----
Ok, here what I have now:
if ($dbProductImageIdNumber) { $ImagesToDeleteNumber = $dbProductImageIdNumber -1 - $numItemImages; echo "$dbProductImageIdNumber" . ' '; echo "$numItemImages" . ' '; echo "$ImagesToDeleteNumber" . ' '; echo "$dbProductId" . ' '; echo "$dbProductThumbnail" . ' '; mysql_query("DELETE FROM wp_posts WHERE post_parent = '$dbProductId' AND ID != '$dbProductThumbnail'"); } Example: my $dbProductId is '16' and $dbProductThumbnail '17'. Qestion is, why this command do not delete any row where post_parent is '16' and ID isn't 17? Any leads?