?how do you read data obtained from an other site in to your database
i am a computer student doing a online stock trading project i am using PHP and a MySQL database, i have encountered a number of problems and would realy appreachate some help if at all possible.
i am able to retrive a stock quote from the internet (code included below), but i need to be able to read this into information inoit my database,
i also need to update this information every so often (it doesent realy matter how often),
any help would nrealy save my ass!
Stock Quotes from Nasdaq
// Choose stock to look at
Stock quote for $symbol
//Connect to URL and read information
$theurl = "http://quotes.nasdaq-amex.com/Quote.dll?"
If (! ($fp = fopen ($theurl, "r" )))
echo " could not open url" ;
$contents = fread ($fp, 1000000);
//find the part of the page we want and output it
$pattern = "(\\\$[0-9 ] + \\ . [0-9 ] + )";
if (eregi($pattern, $contents, $quote))
echo "$symbol was sold at: " ;
echo "no quote available";
echo " "
." This information retrieved from "
. "< a href =\"$theurl\">$theurl "
."on " .(date("1 jS F Y g:i a T"));