?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?how do you read data obtained from an other site in to your database
Author:??(193.1.184.---)
Date:???03-25-03 11:53

hi

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!
catty




Stock Quotes from Nasdaq


// Choose stock to look at
$symbol="AMZN" ;
echo "

Stock quote for $symbol

" ;

//Connect to URL and read information
$theurl = "http://quotes.nasdaq-amex.com/Quote.dll?"
."page=multi&mode=Stock&symbol=".$symbol;
If (! ($fp = fopen ($theurl, "r" )))
{
echo " could not open url" ;
exit;
}
$contents = fread ($fp, 1000000);
fclose($fp);
//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 $quote[1];
} else
{
echo "no quote available";
};
//acknowledge source
echo "
"
." This information retrieved from
"
. "< a href =\"$theurl\">$theurl
"
."on " .(date("1 jS F Y g:i a T"));
?>

?Topics Author? Date
?how do you read data obtained from an other site in to your database??new
catty 03-25-03 11:53?
?Re: how do you read data obtained from an other site in to your database??new
bastien 03-26-03 07:43?
?Re: how do you read data obtained from an other site in to your database??new
bastien 03-26-03 07:49?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
????

Provided By
Phorum