我試圖不重複代碼。有沒有辦法讓這個工作,所以我不必爲三個人寫三次代碼?原諒我的無知:我是初學者。代碼重複(PHP)
$c1 = "Rufus T Firefly";
$c2 = "Chicolini";
$c3 = "Pinky";
for ($i=1; $i<=3; $i++){
$result = mysqli_query($dbc, ' SELECT * FROM voters WHERE choice = "'. $c($i).'" ');
//create table...
}
嗯,用數組吧?傻我 – 2013-02-21 15:21:34