rdburbridgesr Posted January 30, 2015 Share Posted January 30, 2015 So far so good until now. In chapter 12, script 12.7 the following exists and runs fine, but I just don't understand it. In retrieving records and printing them inside the while loop: print "<p><h3>{ From what I have seen thus far, this looks strange and don't understand why the use of the curly and not the parenthesis. Can you please help me understand why replacing the curly with the parin does not work or rather why the curly is needed here? Thank you and your books are awesome. I'm finally getting a grasp on PHP and in so doing is actually helping me understand JavaScript and Perl. Richard Burbridge Link to comment Share on other sites More sharing options...
Larry Posted February 4, 2015 Share Posted February 4, 2015 Thanks for the nice words, Richard. I appreciate it! The full line begins: print "<p><h3>{$row['title']}</h3> If you use $row['title'] within double quotes without the curly braces, you'll get a parse error. The curly braces say "Hey, here's a variable", avoiding the parse errors. That's all! Link to comment Share on other sites More sharing options...
rdburbridgesr Posted February 16, 2015 Author Share Posted February 16, 2015 Makes perfect sense, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts