Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-25-2012, 09:23 AM #1
- Join Date
- Feb 2005
- Bradford, UK
- Thanked 65 Times in 64 Posts
update query inserting blanks instead of specified valuesCode:
update bookings set status ="In Progress" and assignedTo=94 where id=54438
status is enum('New', 'In Progress', 'Booked', 'Cancelled', 'Test')
assignedTo is int(11)
There are no errors or anything
Last edited by NancyJ; 09-25-2012 at 09:44 AM.
09-25-2012, 06:55 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,650 Times in 2,619 Posts
This doesn't look right:
status ="In Progress" and assignedTo=94. I'll have to test when I get home, but the mysql documentation doesn't specify that 'AND' is a valid separator for the properties. So if I had to guess it, it is evaluating this in a bit fashion. "String" & NUMBER I would expect would result in 0, so I can see the status being set to nothing. I don't have an explaination of the assignedTo though, as I'm not sure what the precedence for the = to bitwise AND would be (assuming that is the case). I would almost expect that would be
SET status = ("In Progress" AND assignedTo=94), but that feels like it needs a test.
Needless to say, just drop that "and" and replace it with a comma.