>>392
'(シングルクオーテーション)なので$sampleが展開されない。
"(ダブルクオーテーション)で囲むか、下記のように変える
$result = mysql_query('SELECT id,name FROM sample where id = '.$sample);