Jump to content

about this syntax


astralaaron

Recommended Posts

$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id' LIMIT {$start}, {$per_page}";it works fine theres no problem with it, i just want to understand why { } are around the $start and $per_page?why are { } needed? what do they do?

Link to comment
Share on other sites

Its just so its easier to see, or if you do something like this:

$string = "$myvared and something else";

If for some reason you wanted to add "ed" to the var. It will think the variable name is $myvared when it should actually be $myvar. So you can do this:

$string = "{$myvar}ed and something else";

:)Mainly its used for readability.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...