aeroswat Posted February 17, 2010 Share Posted February 17, 2010 Why this SQL statement is setting the system name to 0? UPDATE tblSchools SET systemName='AIDB Region-09' AND Account='2' AND Region='9' AND Adult='1' AND Reallocations='0.00' WHERE systemName='AIDB Region-09' Quote Link to comment https://forums.phpfreaks.com/topic/192381-can-someone-explain-to-me/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 17, 2010 Share Posted February 17, 2010 Because you are logically AND'ing the value 'AIDB Region-09' with Account='2' AND Region='9' AND Adult='1' AND Reallocations='0.00' and assigning that to systemName. I suspect you meant to create a comma separated list of columns to UPDATE, rather than AND'ing values. Quote Link to comment https://forums.phpfreaks.com/topic/192381-can-someone-explain-to-me/#findComment-1013708 Share on other sites More sharing options...
aeroswat Posted February 17, 2010 Author Share Posted February 17, 2010 Because you are logically AND'ing the value 'AIDB Region-09' with Account='2' AND Region='9' AND Adult='1' AND Reallocations='0.00' and assigning that to systemName. I suspect you meant to create a comma separated list of columns to UPDATE, rather than AND'ing values. Oh. Thank you. I didn't know that the UPDATE queries separated the columns with commas instead. So used to using the logical keywords. Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/192381-can-someone-explain-to-me/#findComment-1013751 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.