I am using cron job to update the stock price in my MySQL table which overwrites the daily price in the same col using Cron Job. Now I want to save daily closing price in a column to calculate Moving averages. I have more than 500 stocks on my table.
mysql_query("UPDATE `stock table`
set
current_price='$current_price',
change='$change',
perchange='$perchange',
post_modified='$updatetime',
update='$update'
where ID='$postid'");
What is the php code to add a col for the price when the date changes for 500 stocks rows?