4
爲什麼我不能進入循環中的getCustomers()
函數?在mysql_fetch_array()有一個奇怪的問題
$stores = $bl->getStoresForGuide($gID); //Returns 6 stores
$storelist = getStoreList($stores); //Generate the HTML for the store list
$brandlist = getCustomers($stores); //Generate the HTML for brand list
function getStoreList($stores)
{
while ($row = mysql_fetch_array($stores)) {
// Do stuff
}
//return result
}
function getCustomers($stores)
{
echo mysql_num_rows($stores); //Outputs 6
while ($row = mysql_fetch_array($stores)) {
echo "test "; // Outputs nothing
}
// Return some result
}
謝謝。不知道。我把結果放在一個數組中,現在它工作正常。 – Steven 2010-01-26 01:46:29