ChadNomad Posted July 14, 2010 Share Posted July 14, 2010 Hi. I want my code to be more efficient and logical and was wondering if anyone could point me in a good direction? For example i concatenate a lot of stuffs as well as escaping a lot. Example; $content = "<p>something</p>".$content; mysql_query("UPDATE the_table SET content='".$content."' WHERE id='".$r['id']."'") or die (mysql_error()); I cant think of any others right now but i'm sure i have lots of bad practices. Thanks Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2010 Share Posted July 14, 2010 There is nothing in that tiny snippet that needs optimizing. The difference between concatenating strings and simply using interpolation is not worth considering & is basically a waste of time. Quote Link to comment 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.