我試圖從數據庫中提取一些結果,但我想我今天有點腦殘。在解析MySQL的結果時遇到麻煩php
$castquery = "SELECT * FROM cast " .
"WHERE player_id = '" . $userid ."' ";
$castresult = mysql_query($castquery) or die(mysql_error());
$castrow = mysql_fetch_array($castresult);
...
foreach($castrow['cast_id'] as $caster)
{
echo "<p>";
if ($caster['avatar_url']!='') echo "<img src=\"".$caster['avatar_url']."\" alt=\"".$caster['name']."\">";
echo "<a href=\"?edit=".$caster['cast_id']."\">".$caster['name']."</a></p>";
}
當然我在這裏可以俯瞰東西明顯。
怎樣的劇本會失敗,什麼結果是你想獲得? – Matchu 2010-01-24 19:07:12