Hi, all
I have one assignment about implement the stock website.
i stuck in some problem which i can't solve.
i want to implement one function which all the $row related to the $result in sql and for each row initialize the class once.
i found if i gave the exactly name of the stock to initialize the class it works. But if i got the name from the sql row, it does not work.
Do not know why this happens??
Here is my code:
Code:
while ($row = mysql_fetch_assoc($result))
{
$A = $row['foo'];
$B = new Quotes ($A, $from, $to);//this one does not work, give me some error information
$B = new Quotes ("$A", $from, $to);//also does not work
$B = new Quotes (AIG, $from, $to);//this one works, AIG is the name of the sotck.
}
Many thanks.