<?php
$connection = mysql_connect( "localhost", "root", "icecream" ) ;
mysql_select_db( "winestore", $connection ) ;
$result = mysql_query( "SELECT surname, firstname, city FROM customer;" ) ;
while( $row = mysql_fetch_array( $result ) ) 
{
print_r( "$row['surname']" ) ;
}
?>
很简单的一段代码,但是print_r那一行出错了,如果把这一行换成print_r("{$row['surname']}")就没问题了,我很纳闷,不加尖括号从语法上来讲有什么错吗?