I'm having having a hard time figuring out why I'm getting "Query was empty". When I run my query. To help debug I print the query that is being executed on the webpage. The strange this is, I can copy that query, paste into phpMyAdmin and it runs without getting, "Query was empty".

Can I not run a query like this in a WHILE loop? Thanks in advance!!


Code:
////////////////////////////////////////////////////////////////////
//If we just printed a label for an information kit
////////////////////////////////////////////////////////////////////

if ($kind == "kit") {

$contactIDs = implode ($selections, ", ");

$details = "A product information kit was assembled today and will be mailed shortly.";

$updateContact = "UPDATE contacts SET needsKit = 'No', modified = '$modified' where contactID in ($contactIDs) and ownerID = '$session_ownerID'";

echo $updateContact;

//mysql_query($updateContact) OR die(mysql_error());

$selectionCount = count($selections);

print ("<p>Contacts in array = $selectionCount<p>");

$x = 0;
while ($x < $selectionCount) {
$position = $x + 1;
echo "<b>Position $position is storing $selections[$x]</b><br>";

$ommunicationInsert = "INSERT INTO communication (ownerID, contactID, date, type, details) VALUES ('$session_ownerID', '$selections[$x]', '$timeStamp', '$type', '$details')";

print ("<p>$ommunicationInsert<p>");
mysql_query($communicationInsert) OR die(mysql_error());

++$x;
}  // end while ($x < $selectionCount) 

} // end if ($kind == "kit")
Here is the output once the button is clicked on needLabel.php. I can't figure out why I'm getting, "Query was empty". r97, are you out there?

Code:
UPDATE contacts SET needsKit = 'No', modified = '2005-02-26' where contactID in (931) and ownerID = '1'

Contacts in array = 1

Position 1 is storing 931

INSERT INTO communication (ownerID, contactID, date, type, details) VALUES ('1', '931', '2005-02-26 05:29:00', 'Note', 'A product information kit was assembled today and will be mailed shortly.')

Query was empty