different methods of using vars in a string
Posted: Wed Apr 20, 2005 8:04 am
ive noticed lately that people use different methods than me when printing there vars for eg i do
some people use a . $username . etc method etc
im just wondering if theres any major differences between the differeing methods and if i should be doing it the way i am and always done for eg an sql string for me would look like
any feedback would be appreciated
Code: Select all
print "Hello {$username}";im just wondering if theres any major differences between the differeing methods and if i should be doing it the way i am and always done for eg an sql string for me would look like
Code: Select all
$query = "SELECT something FROM somewhere WHERE something = '{$value}'";
$result = mysql_query($query) or die (mysql_error());