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 Link to comment https://forums.phpfreaks.com/topic/207712-more-efficient-coding/ 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. Link to comment https://forums.phpfreaks.com/topic/207712-more-efficient-coding/#findComment-1085847 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.