Curly Braces in Mysql Queries

March 23, 2010

I came across a few queries in our newest project and noticed a bunch of them injected their variable data inside curly braces.

I come to find out you can use this in any string in php to encapsulate whatever data you need. Whether it is a simple variable like $x = 0 or a part of an array or object.  I happen to never be aware of this since I usually achieve  the same results by popping out of the string to add my data, ex. $x = “My favorite baseball team is “.$fav_baseball_team.”!”.  It really comes down to aesthetics but still interesting to know.

Stay in Touch!

Subscribe to our newsletter.

Solutions Architecture

browse through our blog articles

Blog Archive