V Posted July 21, 2010 Share Posted July 21, 2010 I'm trying to decide which is better or if there is any significant difference between the two. Both are within function brackets and they seem to work either way. $result = $conn->query("update user set passwd = sha1('".$new_password."') where username = '".$username."'"); $result = $conn->query("update user set passwd = sha1('$new_password') where username = '$username'"); Link to comment https://forums.phpfreaks.com/topic/208475-concatenation-operator-or-just-single-quotes/ Share on other sites More sharing options...
Pikachu2000 Posted July 21, 2010 Share Posted July 21, 2010 Echo them both, and see if they produce the same string. If they do, go with the simplest variation. Link to comment https://forums.phpfreaks.com/topic/208475-concatenation-operator-or-just-single-quotes/#findComment-1089342 Share on other sites More sharing options...
V Posted July 22, 2010 Author Share Posted July 22, 2010 Thanks! They both work so I'll just go with the simple one Link to comment https://forums.phpfreaks.com/topic/208475-concatenation-operator-or-just-single-quotes/#findComment-1089632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.