update query inserting blanks instead of specified values
Code:
update bookings set status ="In Progress" and assignedTo=94 where id=54438
when I run the query the booking gets updated to a status of "" and assignedTo of 0 - wtf?
status is enum('New', 'In Progress', 'Booked', 'Cancelled', 'Test')
assignedTo is int(11)
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.