Hi there, Does anyone know why this doesn't work? // delete keywords associated with that image $sql2 = ("DELETE FROM imagekeyword WHERE (imageid = '$DelPic')"); if (mysql_affected_rows(sql2)) { print "good"; $del_imagekeyword_error = "0"; } I get told that 'mysql_affected_rows(sql2)'is not a valid MySQL-Link resource. Removing the '$sql2' solves it, and the script works, but I can't understand from the documents (http://www.zend.com/manual/function.mysql-affected- rows.php) why it doesn't work when I insert the query variable. Just wondering... Thanks - dunstan --------------------------- Dorset, England http://www.1976design.com/ http://www.orchard.it/ http://www.maccaws.org/