I am building an online portfolio tool... it interacts with yahoo finance.
I basically have 10 symbols in a database, I would like to loop through the database starting at symbol the first value drop it into the below code, when it returns the value, I would like to take the values of the array and update the database based on these values.
Company Name: <?=$read[0];?>
Stock Symbol: <?=$read[1];?>
Exchange: <?=$read[2];?>
Current Stock Price: <?=$read[3];?>
Declared Dividend: <?=$read[14];?>
So basically I want query yahoo, get the result and update my database until there are no more stocks to update. If possible I would like the process to do one about every 15 seconds and than move to the next, when finished start over at the beginning again.
The database fields are:
`company`<-- Company Name
`exchange` <-- Exchange
`price` <-- Price
`stock_index` <-- Symble
'dividend' <-- dividend
So the field that is used for the original query is stock_index, I need to loop through that and use it to update the others.
Start Free Trial