Code: Select all
$sql = mysql_query("UPDATE `basic` SET gender='($newgender)',month='($newmonth)',day='($newday)',year = '($newyear)' WHERE userid = '($userid)'");Moderator: General Moderators
Code: Select all
$sql = mysql_query("UPDATE `basic` SET gender='($newgender)',month='($newmonth)',day='($newday)',year = '($newyear)' WHERE userid = '($userid)'");In fact, you can include any value that is in the namespace in strings with this syntax. You simply write the expression the same way as you would outside the string, and then include it in { and }.
Code: Select all
//1st test
$mystr = "lala $myvar";
//2nd test
$mystr = "lala {$myvar}";
//3rd test
$mystr = "lala ".$myvar; //<-- faster