Forum Moderators: coopster

Message Too Old, No Replies

Query was empty!?!

Clearly it isn't though! Or is it?

         

delboy1978uk

1:26 pm on May 22, 2007 (gmt 0)

10+ Year Member



Hi guys, I designed a page, and as usual, i echo the output queries until i am happy, then i will remove that and run the queries for the finished page.

This page should do the following:

Create a delivery note
Edit the orderdetails to say X out of Y have been delivered
Insert deliverynote details

My queries (this was from within a for next loop to generate each one) were like this:

INSERT INTO delnotes (delnoteid, orderid, deldate) VALUES (1, 0000006, '2007-05-22')

UPDATE actualorderdetails SET delivered = 2 WHERE orderdetailsid = 23
INSERT INTO deldetails (delnoteid, orderdetailsid, quantity) VALUES (1, 23, 2)
UPDATE actualorderdetails SET delivered = 0 WHERE orderdetailsid = 37
INSERT INTO deldetails (delnoteid, orderdetailsid, quantity) VALUES (1, 37, 0)
UPDATE actualorderdetails SET delivered = 0 WHERE orderdetailsid = 38
INSERT INTO deldetails (delnoteid, orderdetailsid, quantity) VALUES (1, 38, 0)
UPDATE actualorderdetails SET delivered = 1 WHERE orderdetailsid = 39
INSERT INTO deldetails (delnoteid, orderdetailsid, quantity) VALUES (1, 39, 1)

This was all looking good on my page so i
uncommented the mysql_query lines so the queries would run.
This is what i got:

INSERT INTO delnotes (delnoteid, orderid, deldate) VALUES (1, 0000006, '2007-05-22')

UPDATE actualorderdetails SET delivered = 2 WHERE orderdetailsid = 23
INSERT INTO deldetails (delnoteid, orderdetailsid, quantity) VALUES (1, 23, 2)
Query was empty

query was empty? but as you saw they weren't.

So I checked to see what had been inserted / updated

The delnote was inserted
the orderdetails for the first update statement ran
the first insert into deldetails did not run
none of the other queries ran

so i take it then that this query:

INSERT INTO deldetails (delnoteid, orderdetailsid, quantity) VALUES (1, 23, 2)

was empty?

dont understand :-( can anyone help?

delboy1978uk

1:34 pm on May 22, 2007 (gmt 0)

10+ Year Member



Damnit! Sorry guys just fixed it! Bloody typo!
Why is it that half the time the very act of posting your problem suddenly makes you figure out what the problem is?

HelenDev

3:59 pm on May 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why is it that half the time the very act of posting your problem suddenly makes you figure out what the problem is?

Aha, perhaps a rhetorical question, but I've often wondered this myself. I think it's to do with stripping down the problem to try and make it easier for someone else to understand, and thus making it easier for you to spot the problem too :)