SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Feb 25, 2005, 23:35 #1
- Join Date
- Sep 2004
- Location
- Provo, UT
- Posts
- 865
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Shouldn't be getting, "Query was empty"
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")
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
Convert your dollars into silver coins. www.convert2silver.com
-
Feb 26, 2005, 04:59 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
Originally Posted by busboy
perhaps you could get one of the moderators to move this question into the php forum for you
-
Feb 26, 2005, 06:46 #3
Moved to a more appropriate forum
SeanHarry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
-
Feb 26, 2005, 08:32 #4
$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());
Probably yet another typo that wasted many hours. I've had my fair share of those, too.
-
Feb 26, 2005, 10:30 #5
- Join Date
- Sep 2004
- Location
- Provo, UT
- Posts
- 865
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
That would explain why I could copy and paste the query into myPHPAdmin and it worked fine. Thanks Icheb!!
Convert your dollars into silver coins. www.convert2silver.com
Bookmarks