PHP到阵列 - 故障排除

Bra*_*lly 0 php arrays

我知道我在这里犯了新手错误,而且我需要制作一个变量来传递 - 虽然我不知道如何处理这个,但在线搜索并没有帮助.如果有人能引导我朝着正确的方向前进,我将非常感激.

我想将结果回显成一个数组.那是; 在$ rss数组中显示'xml'表中的'xmlurl'行字段.我希望这是有道理的.

// Get URLs from Database
$result = mysql_query("SELECT * FROM xml");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("'%s',", $row["xmlurl"]);
}
mysql_free_result($result);

// Take the URLs (xmlurl) and place them in an array
$rss = array(
'http://www.xmlurl.com.au',
'http://www.xmlurl.com.au'
);
Run Code Online (Sandbox Code Playgroud)

dec*_*eze 7

$rss = array();
while (...) {
    $rss[] = $row['xmlurl'];
}
Run Code Online (Sandbox Code Playgroud)